[arquillian-issues] [JBoss JIRA] (ARQ-1976) All ResourceProvider#canProvide implementations could try to inject subtypes

Aslak Knutsen (JIRA) issues at jboss.org
Tue Sep 1 20:48:07 EDT 2015


     [ https://issues.jboss.org/browse/ARQ-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aslak Knutsen closed ARQ-1976.
------------------------------


> All ResourceProvider#canProvide implementations could try to inject subtypes
> ----------------------------------------------------------------------------
>
>                 Key: ARQ-1976
>                 URL: https://issues.jboss.org/browse/ARQ-1976
>             Project: Arquillian
>          Issue Type: Bug
>            Reporter: Radoslav Husar
>             Fix For: 1.1.9.Final
>
>
> Currently the conditions seem to be the other way round as they normally would:
> {noformat}
>     @Override
>     public boolean canProvide(Class<?> type)
>     {
> -      return Deployer.class.isAssignableFrom(type);
> +      return type.isAssignableFrom(Deployer.class);
>     }
> {noformat}
> It does not seem to be intentional. This would not be usually spotted because usually the same class is injected and requested and no provider provides a subtype of other ResourceProvider, so the problem would never occur.
> The resulting exception would look like:
> {noformat}
> java.lang.RuntimeException: Could not set value on field protected ClassA TestClass.field using ClassB at 19b89d4, 
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the arquillian-issues mailing list