Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-159

Use BeanManager#resolve instead of iteration in SEArtifactFactory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.1.0.Final
    • 1.0.0.Final
    • jberet-se
    • None

      org.jberet.se.SEArtifactFactory#getBean currently iterates thru the results of beanManager.getBeans(ref), and returns the first element (there should be only 1 element in the results).

      We should use javax.enterprise.inject.spi.BeanManager#resolve instead.

      resolve method basically does:

      • if beans is null or empty, return null;
      • if only 1 element, return it;
      • if more than 1 element, throw ambiguous deps exception.

              cfang@redhat.com Cheng Fang
              cfang@redhat.com Cheng Fang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: