You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2016/02/24 12:46:18 UTC
[jira] [Resolved] (OWB-1122) InjectionPoint.getQualifiers does not
return the list of selected qualifiers with programmatic lookup
[ https://issues.apache.org/jira/browse/OWB-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Romain Manni-Bucau resolved OWB-1122.
-------------------------------------
Resolution: Fixed
Assignee: Romain Manni-Bucau
Fix Version/s: 1.6.4
> 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
> Assignee: Romain Manni-Bucau
> Fix For: 1.6.4
>
>
> 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)