[
https://issues.apache.org/jira/browse/OWB-1216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mark Struberg reassigned OWB-1216:
----------------------------------
Assignee: Mark Struberg
> InjectionPoint.getType() returns wrong type for produced beans
> --------------------------------------------------------------
>
> Key: OWB-1216
> URL: https://issues.apache.org/jira/browse/OWB-1216
> Project: OpenWebBeans
> Issue Type: Bug
> Reporter: John D. Ament
> Assignee: Mark Struberg
> Priority: Major
>
> Assuming I have a producer (same thing happens for a custom registered 3rd
> party bean, this is just easier to demonstrate):
> {code}
> public class MyProducer {
> @Produces
> @SomeQualifier
> public String doProducer(InjectionPoint ip) {
> return ip.getType().toString();
> }
> }
> {code}
> As well as the following injection point (with test):
> {code}
> @Inject
> @SomeQualifier
> private String myString;
>
> @Test
> public void shouldBeStringType() {
> assertThat(myString).isEqualTo(String.class.toString());
> }
> {code}
> The expectation is that the value of {{myString}} is {{java.lang.String}} but
> actually the value is the producer {{MyProducer}}. We should be relying on
> the injection point's value, not the producer class. It seems that it uses
> the value of {{getBeanClass}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)