[weld-dev] BeanManager#getBeans question

Laird Nelson ljnelson at gmail.com
Fri Jan 11 18:00:06 EST 2019


Before I file an issue I want to make sure I'm not mistaken in my
assumption of what should happen.

Suppose I have a set of qualifiers consisting of Any.Literal.INSTANCE and
Default.Literal.INSTANCE.

Suppose there are two beans in the CDI container of type Foo.  Neither is
annotated with @Default or @Any.

Suppose that during startup I call beanManager.getBeans(Foo.class,
setOfQualifiersAsDefinedAbove).

I'm observing that in such a case I get a returned Set that has one of the
two Foo beans, not both of them.  Which one is in the set seems to be
random.

If instead I call simply beanManager.getBeans(Foo.class) I get both beans.

These calls should return equivalent results, yes?

Best,
Laird
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20190111/58899162/attachment.html 


More information about the weld-dev mailing list