ProcessBeanAttributes fired for producer methods and producer fields has wrong type
argument
--------------------------------------------------------------------------------------------
Key: WELD-1046
URL:
https://issues.jboss.org/browse/WELD-1046
Project: Weld
Issue Type: Bug
Reporter: Martin Kouba
Assignee: Jozef Hartinger
Fix For: 2.0.0.Alpha1
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|https://github.com/weld/core/blob/2.0/tests-arquillian...]:
{code}
void observeBravo(@Observes ProcessBeanAttributes<BravoProducer> event) {
bravo = event.getBeanAttributes();
}
void observeCharlie(@Observes ProcessBeanAttributes<CharlieProducer> event) {
charlie = event.getBeanAttributes();
}
{code}
should be replaced with:
{code}
void observeBravo(@Observes ProcessBeanAttributes<Bravo> event) {
bravo = event.getBeanAttributes();
}
void observeCharlie(@Observes ProcessBeanAttributes<Charlie> event) {
charlie = event.getBeanAttributes();
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira