]
Martin Kouba commented on CDI-608:
----------------------------------
I'm not sure. But we need the complete information to simulate the problem.
Fix generics used within addObserverMethod
------------------------------------------
Key: CDI-608
URL:
https://issues.jboss.org/browse/CDI-608
Project: CDI Specification Issues
Issue Type: Feature Request
Reporter: John Ament
the following code doesn’t compile:
{code}
cdiEventEndpoints.values().stream().forEach(endpoint -> abd.addObserverMethod()
.beanClass(CdiEventComponent.class)
.observedType(endpoint.getType())
.qualifiers(endpoint.getQualifiers())
.notifyWith(endpoint::notify);
{code}
I need to write:
{code}
cdiEventEndpoints.values().stream().forEach(endpoint -> addCdiEventObserver(abd,
endpoint));
private <T> void addCdiEventObserver(AfterBeanDiscovery abd,
CdiEventEndpoint<T> endpoint) {
abd.<T>addObserverMethod()
.beanClass(CdiEventComponent.class)
.observedType(endpoint.getType())
.qualifiers(endpoint.getQualifiers())
.notifyWith(endpoint::notify);
}
{code}