[ 
http://issues.ops4j.org/browse/QI-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13729#action_13729
 ] 

Niclas Hedhman commented on QI-306:
-----------------------------------

Ahhh, yes, since List<Abc>.class is not possible, nor is there a 
List<Abc>.parameterizedtype keyword...

> Exception thrown when @Using on complex generic types
> -----------------------------------------------------
>
>                 Key: QI-306
>                 URL: http://issues.ops4j.org/browse/QI-306
>             Project: Qi4j
>          Issue Type: Bug
>          Components: Core Runtime
>    Affects Versions: 1.2
>         Environment: Any.
>            Reporter: Stanislav Muhametsin
>             Fix For: 1.3
>
>         Attachments: ComplexUsesGenericTypesTest.java
>
>
> When using @Uses -injection with more complex generics-usage scenario, an 
> exception (org.qi4j.api.common.InvalidApplicationException: Could not 
> register <object class>, which is caused by class cast exception) is thrown 
> during bootstrapping. The inner exception is thrown at  
> org.qi4j.runtime.injection.DependencyModel , on line 204, in method 
> extractInjectionClass . Testcase attached.
> {code}
> public class ComplexUsesGenericTypesTest extends AbstractQi4jTest
> {
>     public static class AbstractTestObject<ClassType, RealClassType extends 
> ClassType>
>     {
>         @Uses
>         private Class<RealClassType> clazz;
>         public void printClazz()
>         {
>             LoggerFactory.getLogger( this.getClass() ).debug( "Clazz: " + 
> this.clazz );
>         }
>     }
>     public static class TestObject extends AbstractTestObject<TestObject, 
> TestObject>
>     {
>     }
>     public void assemble( ModuleAssembly module )
>         throws AssemblyException
>     {
>         module.addObjects( TestObject.class );
>     }
>     @Test
>     public void performTest()
>     {
>         ObjectBuilder<TestObject> builder = 
> this.objectBuilderFactory.newObjectBuilder( TestObject.class );
>         builder.use( TestObject.class );
>         builder.newInstance().printClazz();
>     }
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to