Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1.8, 1.2.1
-
None
Description
if there are e.g. 3 managed-beans implementing the same interface (2 classes with custom qualifiers and 1 producer-method), a dyn. usage via javax.enterprise.inject.Instance#iterator (+ @Any) can result in 2 contextual-instances (instead of 3). it happens if the producer-method is used to select one of the other two beans and expose it with a different qualifier - e.g.:
public class DefaultSelector {
@Produces
@Default
@Dependent
protected MyInterface selectDefault(
@Qualifier1 MyInterface bean1,
@Qualifier2 MyInterface bean2) {
if (/.../)
}
reason:
InstanceImpl#iterator is using a HashSet to collect the contextual-instances.