[
https://jira.jboss.org/jira/browse/WELD-454?page=com.atlassian.jira.plugi...
]
Matthieu Chase Heimer commented on WELD-454:
--------------------------------------------
I think this might be a wording bug in the spec, later on page 72 it states "Other,
less specific, observers will also be notified of this event:"
So if you believe page 72, close the bug, if you believe the wording on 71 leave it open.
I'm guessing the spec needs to change to "An event is delivered to an observer
method if the observer method has *matching* event qualifiers."
Observer resolution (event qualifier handling) not in-line with spec
--------------------------------------------------------------------
Key: WELD-454
URL:
https://jira.jboss.org/jira/browse/WELD-454
Project: Weld
Issue Type: Bug
Components: Documentation, Events
Affects Versions: 1.0.0.GA, 1.0.1.Final
Environment: Windows XP SP3, JDK 1.6 u17, GlassFish v3
Reporter: Matthieu Chase Heimer
Page 71 of the spec states: An event is delivered to an observer method if the observer
method has *ALL* the event qualifiers. (emphasis mine). The behavior of Weld is if all
method qualifiers are present on the event then the method will receive the event.
//event injection point
@Inject @Q1 @Q2 Event<Color> colorEvent;
//fire event
colorEvent.fire(Color.BLUE);
//All events have both a Q1 and Q2 qualifier
//only the last method should be called but all four methods are called
public class ColorChangeConsumer {
public void onAnyColorChange(@Observes Color color) {}
public void onQ1ColorChange(@Observes @Q1 Color color) {}
public void onQ2ColorChange(@Observes @Q2 Color color) {}
public void onQ1QQ2ColorChange(@Observes @Q1 @Q2 Color color) {}
}
This behavior is also seen when using Event.select as seen in the docs:
http://docs.jboss.org/weld/reference/1.0.1-Final/en-US/html_single/#d0e4194
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira