You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Antonin Stefanutti (JIRA)" <ji...@apache.org> on 2016/02/23 12:06:18 UTC

[jira] [Created] (OWB-1122) InjectionPoint.getQualifiers does not return the list of selected qualifiers with programmatic lookup

Antonin Stefanutti created OWB-1122:
---------------------------------------

             Summary: InjectionPoint.getQualifiers does not return the list of selected qualifiers with programmatic lookup
                 Key: OWB-1122
                 URL: https://issues.apache.org/jira/browse/OWB-1122
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.6.3
            Reporter: Antonin Stefanutti


With a {{@Dependent}} producer method retrieving the {{InjectionPoint}} instance in case of a programmatic lookup, the method {{InjectionPoint.getQualifiers}} does not return the subset of qualifiers specified in during the lookup with {{Instance.select}}.

The following test case: 
{code}
@RunWith(Arquillian.class)
public class OwbTest {

    @Deployment
    public static Archive<?> deployment() {
        return ShrinkWrap.create(JavaArchive.class)
            // Test class
            .addClass(Beans.class)
            // Bean archive deployment descriptor
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    }

    @Any
    @Inject
    Instance<String> strings;

    @Test
    public void test() {
        System.out.println(strings.select(new AnnotationLiteral<MyQualifier>() {
        }).get());
    }
}

class Beans {

    @Produces
    @MyQualifier
    String producer(InjectionPoint ip) {
        return Objects.toString(ip.getQualifiers());
    }
}

@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@interface MyQualifier {

}
{code}

Outputs:
{code}
[@javax.enterprise.inject.Any()]
{code}

While it would be expected to outputs:
{code}
[@MyQualifier(), @javax.enterprise.inject.Any()]
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)