[cdi-dev] Expected value of getType() for the injection point of an Instance object

Martin Kouba mkouba at redhat.com
Mon Sep 11 08:00:08 EDT 2017


I'm sorry John but if you need concrete answer you should provide 
concrete  instructions.

In the TCK test there is @Dependent Foo which injects InjectionPoint and 
then the test does @Inject @Any Instance<Foo>, obtains the Foo instance 
and inspects the InjectionPoint metadata. In fact, bar.getFoo() returns 
a child Instance<Foo> with additional qualifier @Default. So it should 
Foo.class.

Martin

Dne 11.9.2017 v 13:25 John Ament napsal(a):
> Martin,
> 
> 
> Sorry, but I'm looking for a concrete answer.  The tests you point to 
> never test when the injection point is an Instance<> or Provider<>, e.g. 
> the CDI built in beans.
> 
> 
> What I'm looking for would be something like "It should be a 
> ParameterizedType impl that represents Instance<Foo>" or "It should be 
> the class Foo.class" or something else along those lines.
> 
> 
> Thanks,
> 
> 
> John
> 
> 
> 
> ------------------------------------------------------------------------
> *From:* Martin Kouba <mkouba at redhat.com>
> *Sent:* Monday, September 11, 2017 7:00 AM
> *To:* John Ament; cdi-dev
> *Subject:* Re: [cdi-dev] Expected value of getType() for the injection 
> point of an Instance object
> Hi John,
> 
> I believe it should be the required type of the injected Instance (which
> is the type parameter specified at the injection point - defined in
> "5.6.1. The Instance interface" and "5.5.7. Injection point metadata")
> unless you modify the type using Instance.select().
> 
> getType() is tested in:
> https://github.com/cdi-spec/cdi-tck/blob/master/impl/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/dynamic/DynamicInjectionPointTest.java#L74 
> 
> 
> and line 75
> 
> getQualifiers():
> https://github.com/cdi-spec/cdi-tck/blob/master/impl/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/dynamic/DynamicInjectionPointTest.java#L86 
> 
> 
> and line 87
> 
> Martin
> 
> Dne 11.9.2017 v 12:40 John Ament napsal(a):
>> Hi,
>> 
>> 
>> I found a small issue within OWB.  The closest found TCK test (found by 
>> Romain) is 
>> https://github.com/cdi-spec/cdi-tck/blob/master/impl/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/dynamic/DynamicInjectionPointTest.java#L99 
> which
> 
>> tests the Instance type, but not the value of InjectionPoint.getType(). 
>>   What should be the return value of getType() here?
>> 
>> 
>> John
>> 
>> 
>> ------------------------------------------------------------------------
>> NOTICE: This e-mail message and any attachments may contain 
>> confidential, proprietary, and/or privileged information which should be 
>> treated accordingly. If you are not the intended recipient, please 
>> notify the sender immediately by return e-mail, delete this message, and 
>> destroy all physical and electronic copies. Thank you.
>> 
>> 
>> _______________________________________________
>> cdi-dev mailing list
>> cdi-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 
>> 
>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas 
> provided on this list, the provider waives all patent and other 
> intellectual property rights inherent in such information.
> 
>> 
> 
> -- 
> Martin Kouba
> Senior Software Engineer
> Red Hat, Czech Republic
> ------------------------------------------------------------------------
> NOTICE: This e-mail message and any attachments may contain 
> confidential, proprietary, and/or privileged information which should be 
> treated accordingly. If you are not the intended recipient, please 
> notify the sender immediately by return e-mail, delete this message, and 
> destroy all physical and electronic copies. Thank you.
> 
> 
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
> 

-- 
Martin Kouba
Senior Software Engineer
Red Hat, Czech Republic


More information about the cdi-dev mailing list