<font size=2 face="sans-serif">Hello<br>
<br>
I was made aware of the difference on the return of beanManager.getBeans(Object.class)
between OWB and Weld</font>
<br>
<br><font size=2 face="sans-serif">In OWB, it returns all beans, unless
there is an enabled @alternative within the application. If there is an
enabled @alternative getBeans() only returns beans annotated @alternative.</font>
<br>
<br><font size=2 face="sans-serif">However, in Weld, it returns all beans
even with an enabled @alternative.</font>
<br>
<br><font size=2 face="sans-serif">The JavaDoc for BeanMnanager says &quot;according
to the rules of typesafe resolution&quot; and in the CDI 1.0 spec under
typesafe resolution I find one mention of alternatives: “When an ambiguous
dependency exists, the container attempts to resolve the ambiguity. The
container eliminates all eligible beans that are not alternatives, except
for producer methods and fields of beans that are alternatives.” (This
text is also in the CDI 1.2 spec)</font>
<br>
<br><font size=2 face="sans-serif">However this would imply that if there
are no enabled @Alternatives an ambiguous resolution like beanManager.getBeans(Object.class)
should discard everything. In this case, the Weld behaviour is incorrect.
beanManager.getBeans() should only return the resolved or enabled beans.</font>
<br><font size=2 face="sans-serif"><br>
Regards<br>
Benjamin<br>
</font>
<br><font size=2 face="sans-serif">Can someone verify this?<br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>