Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-694

Make an observer that uses both @Observes and @ObservesAsync forbidden

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0 .Final
    • None
    • None
    • None

      Not explicitly called out in the spec text, we should make an observer that has both annotations forbidden.

      RI presently throws a DefinitionException.

            [CDI-694] Make an observer that uses both @Observes and @ObservesAsync forbidden

            Totally agree with you mkouba@redhat.com

            Antoine Sabot-Durand (Inactive) added a comment - Totally agree with you mkouba@redhat.com

            It's always better to say what happens if a rule is violated.

            Martin Kouba added a comment - It's always better to say what happens if a rule is violated.

            Well, section 10.4.2 start with the following mention:

            An observer method may be declared by annotating a parameter @javax.enterprise.event.Observes or @javax.enterprise.event.ObservesAsync of a default-access

            But we could add a mention to say when and how the container should handle such a conflict.

            Antoine Sabot-Durand (Inactive) added a comment - Well, section 10.4.2 start with the following mention: An observer method may be declared by annotating a parameter @javax.enterprise.event.Observes or @javax.enterprise.event.ObservesAsync of a default-access But we could add a mention to say when and how the container should handle such a conflict.

              asabotdu@redhat.com Antoine Sabot-Durand (Inactive)
              meetoblivion_jira John Ament (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: