Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2826

In SE, the reflection discovery strategy incorrectly discovers beans with just inherited BDA

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 6.0.4.Final, 7.0.0.Alpha2
    • 7.0.0.Alpha1, 6.0.3.Final, 5.1.6.Final
    • Java SE Support
    • None

      The ReflectionDiscoveryStrategy, with annotated discovery mode, wrongly discovers classes that only have inherited bean defining annotations as beans.
      According to the specification, the class has to declare the BDA to be considered having one; inheritance alone is not enough.

      Note that the Jandex discovery strategy is unaffected (except for small fallback code part which will be fixed as well).

      For instance, in the following case, the class Bam should not be discovered:

      @ApplicationScoped
      class Baz implements Bar {
      }
      
      // no explicit BDA, but inherited app scope
      class Bam extends Baz {
      }
      

              manovotn Matěj Novotný
              manovotn Matěj Novotný
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: