Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-929

implicit filter in InstanceImpl#iterator

    XMLWordPrintableJSON

    Details

      Description

      if there are e.g. 3 managed-beans implementing the same interface (2 classes with custom qualifiers and 1 producer-method), a dyn. usage via javax.enterprise.inject.Instance#iterator (+ @Any) can result in 2 contextual-instances (instead of 3). it happens if the producer-method is used to select one of the other two beans and expose it with a different qualifier - e.g.:

      public class DefaultSelector {
      @Produces
      @Default
      @Dependent
      protected MyInterface selectDefault(
      @Qualifier1 MyInterface bean1,
      @Qualifier2 MyInterface bean2) {
      if (/.../)

      { return bean1; return bean2; }

      }

      reason:
      InstanceImpl#iterator is using a HashSet to collect the contextual-instances.

        Attachments

        1. OWB-929.patch
          1 kB
          Gerhard Petracek

          Activity

            People

            • Assignee:
              gpetracek Gerhard Petracek
              Reporter:
              gpetracek Gerhard Petracek
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: