Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
2.4.2.Final
-
None
Description
Don't know if this is really an issue, but if I understood the CDI spec correctly when I select beans without any Qualifier I should also find qualified beans.
https://github.com/robertpanzer/cdi-arquillian-test contains an executable test for this.
The gist of this test is that I have a qualified bean:
@Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Qualifier public @interface TestQualifier { } @TestQualifier public class QualifiedBean { public int f() { return 42; } }
Now imo I should find this bean when I select the type without any qualifier:
final Instance<QualifiedBean> instance = CDI.current().select(QualifiedBean.class);
QualifiedBean bean = instance.get();
But instead it fails with an Exception:
org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001334: Unsatisfied dependencies for type QualifiedBean with qualifiers WELD-001475: The following beans match by type, but none have matching qualifiers: - Managed Bean [class com.walmart.cditest.QualifiedBean] with qualifiers [@TestQualifier @Any]
The same tests works with OpenWebBeans 1.7.1.
I am not 100% sure about the spec, so I am happy if this works as expected.