[ 
https://issues.apache.org/jira/browse/OWB-929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated OWB-929:
---------------------------------

    Attachment:     (was: OWB-929.patch)

> implicit filter in InstanceImpl#iterator
> ----------------------------------------
>
>                 Key: OWB-929
>                 URL: https://issues.apache.org/jira/browse/OWB-929
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.1.8, 1.2.1
>            Reporter: Gerhard Petracek
>             Fix For: 1.1.9, 1.2.2, 2.0.0
>
>
> 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 (/*...*/) {
>             return bean1;
>         return bean2;
>     }
> }
> reason:
> InstanceImpl#iterator is using a HashSet to collect the contextual-instances.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to