The attached testcase fails constructing the mapping factory when mapping a
class. The class has self referential generics (Foo <T extends Foo<T>>) and
also a getter that returns an Optional<Range<String>>. The mapping construction
will fail with the following exception:
Caused by: java.lang.IllegalArgumentException: types Foo and Range<String> are
not comparable
at ma.glasnost.orika.metadata.TypeUtil.getMostSpecificType(TypeUtil.java:157)
at ma.glasnost.orika.metadata.TypeUtil.resolveActualTypeArguments(TypeUtil.java:94)
at ma.glasnost.orika.metadata.TypeUtil.resolveActualTypeArguments(TypeUtil.java:55)
at ma.glasnost.orika.metadata.TypeFactory.resolveValueOf(TypeFactory.java:396)
at ma.glasnost.orika.property.PropertyResolver.resolveGenericType(PropertyResolver.java:174)
at ma.glasnost.orika.property.PropertyResolver.resolvePropertyType(PropertyResolver.java:312)
at ma.glasnost.orika.property.PropertyResolver.processProperty(PropertyResolver.java:248)
at ma.glasnost.orika.property.IntrospectorPropertyResolver.collectProperties(IntrospectorPropertyResolver.java:83)
The Optional<Range<C extends Comparable<C>>> does work without the self
referential generics, and the self referential generics work as advertised when
used without the getter returning the Optional<Range<C...>
See the attached test case for the failure.
Original issue reported on code.google.com by martijn....@gmail.com on 8 May 2014 at 1:44
Original issue reported on code.google.com by
martijn....@gmail.com
on 8 May 2014 at 1:44Attachments: