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

The container cannot use the final value of AfterTypeDiscovery.getAlternatives() properly

XMLWordPrintable

    • Icon: Clarification Clarification
    • Resolution: Obsolete
    • Icon: Minor Minor
    • 2.1 (Discussion)
    • 1.2.Final
    • None

      Any observer of this event is permitted to add classes to, or remove classes from, the list of alternatives, list of interceptors or list of decorators. The container must use the final values of these collections, after all observers of AfterTypeDiscovery have been called, to determine the order of the enabled alternatives, interceptors, and decorators for application. The initial values of these collections are defined by the @Priority annotation.

      However, the container cannot use the final value of the alternatives collection properly. The problem occurs if an extension adds an alternative class.

      The container can either:

      • use the index from the list -> selected alternatives with the same priority will not cause AmbiguousResolutionException (this contradicts the spec), or
      • use the original priority, an alternative added by an extension will be selected for an application but without any priority value (this contradicts the spec) -> an extension would not be able to affect the final ordering

      The first option seems to be less harmful.

              Unassigned Unassigned
              mkouba@redhat.com Martin Kouba
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: