-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
The spec (CDI 1.1) states: "The event object must be of type javax.enterprise.inject.spi.ProcessBeanAttributes<T> where T is the bean class of the managed bean or session bean, the return type of the producer method, or the type of the producer field."
However events fired for producer methods and producer fields are of type javax.enterprise.inject.spi.ProcessBeanAttributes<T> where T is the declaring bean class, not the return type or the type of the field.
There is also invalid test in weld test suite - VerifyValuesTest. Observer methods in VerifyingExtension:
void observeBravo(@Observes ProcessBeanAttributes<BravoProducer> event) { bravo = event.getBeanAttributes(); } void observeCharlie(@Observes ProcessBeanAttributes<CharlieProducer> event) { charlie = event.getBeanAttributes(); }
should be replaced with:
void observeBravo(@Observes ProcessBeanAttributes<Bravo> event) { bravo = event.getBeanAttributes(); } void observeCharlie(@Observes ProcessBeanAttributes<Charlie> event) { charlie = event.getBeanAttributes(); }