Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-454

Observer resolution (event qualifier handling) not in-line with spec

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 1.0.0.GA, 1.0.1.Final
    • Documentation, Events
    • None

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            chasetec_jira Matthieu Chase Heimer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: