You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Joe Bergmark (JIRA)" <ji...@apache.org> on 2013/12/17 17:29:07 UTC

[jira] [Resolved] (OWB-868) Producer ArrayList + producer List = j.e.i.AmbiguousResolutionException

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

Joe Bergmark resolved OWB-868.
------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.0
         Assignee: Joe Bergmark

Added a unit test to verify this does indeed work in trunk.  My guess is that this was bug was resolved during the 1.2 re-factoring work.

> Producer ArrayList<String> + producer List<Integer> = j.e.i.AmbiguousResolutionException
> ----------------------------------------------------------------------------------------
>
>                 Key: OWB-868
>                 URL: https://issues.apache.org/jira/browse/OWB-868
>             Project: OpenWebBeans
>          Issue Type: Bug
>    Affects Versions: 1.1.8
>         Environment: J2SE + IBM JDK 7
>            Reporter: Denis Forveille
>            Assignee: Joe Bergmark
>             Fix For: 1.2.0
>
>         Attachments: OWB-868.zip
>
>
> With this bean that provides 2 producers that return 2 differents kinds of objects:
>    @Produces
>    @Named("list1")
>    public ArrayList<String> getListe1() {
>       return null;
>    }
>    @Produces
>    @Named("list2")
>    public List<Integer> getListe2() {
>       return null;
>    }
> And this bean that get injected one of the produced object:
>    @Inject public List<Integer> listInteger;
> The application fails with  "javax.enterprise.inject.AmbiguousResolutionException"
> Exception in thread "main" javax.enterprise.inject.AmbiguousResolutionException: Ambigious resolution
> found beans: 
> List, Name:list2, WebBeans Type:PRODUCERMETHOD, API Types:[java.lang.Iterable,java.lang.Object,java.util.Collection,java.util.List], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]
> ArrayList, Name:list1, WebBeans Type:PRODUCERMETHOD, API Types:[java.util.AbstractList,java.util.ArrayList,java.util.RandomAccess,java.lang.Iterable,java.util.AbstractCollection,java.util.Collection,java.lang.Object,java.io.Serializable,java.util.List,java.util.Collection,java.lang.Iterable,java.util.List,java.lang.Cloneable], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]
> If we change the return type of the firts producer from ArrayList by List, it works !!
> Check the attached zip



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)