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

Transitive stereotype declarations - clarify conflicting default scopes

    XMLWordPrintable

    Details

    • Type: Clarification
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Out of Date
    • Affects Version/s: None
    • Fix Version/s: 2.1 (Discussion)
    • Component/s: None
    • Labels:
      None

      Description

      Stereotype declarations are transitive. However, the spec is not clear what happens if a stereotype declares a default scope and also a second stereotype which also declares a default scope. Only "If a stereotype declares more than one scope, the container automatically detects the problem and treats it as a definition error." is defined.

      Weld currently does merge the stereotypes and throws DefinitionException if NOT all stereotypes specify the same scope and the bean does NOT declare a scope (this makes sense imho).

      Note that this is not a problem for @Named, @Alternative and interceptor bindings.
      Any @Alternative makes a bean an alternative. Any @Named means the name is defaulted. All bindings are added to the set.

      UPDATE: Interceptor bindings are probably also affected. The interceptors spec defines "An interceptor binding declared on a method or constructor replaces an interceptor binding of the same type declared at class level or inherited from a superclass." (3.3 Binding an Interceptor to a Component) which implies that multiple interceptor bindings of the same type are not supported. So the spec should probably cover cases where stereotypes declare the interceptor bindings of the same type.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mkouba@redhat.com Martin Kouba
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: