[
https://issues.apache.org/jira/browse/ARIES-1500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15178089#comment-15178089
]
Guillaume Nodet commented on ARIES-1500:
----------------------------------------
See "Type Conversion", section 121.9.3 of the OSGi specs for available
conversions.
To implement a converter, define a class implementing
{{org.osgi.service.blueprint.container.Converter}} and register it this way:
{code}
<type-converters>
<bean class="org.apache.aries.blueprint.pojos.ConverterA"/>
</type-converters>
{code}
You'll find an example at
https://github.com/apache/aries/blob/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/pojos/ConverterA.java
As for the factory returning a generic type, I know it should be possible to
store the information somewhere, but this would be very intrusive in the
current code base I think.
> Conversion fails with generics
> ------------------------------
>
> Key: ARIES-1500
> URL: https://issues.apache.org/jira/browse/ARIES-1500
> Project: Aries
> Issue Type: Bug
> Components: Blueprint
> Affects Versions: blueprint-core-1.5.0
> Environment: All
> Reporter: Jean-Philippe CLEMENT
>
> Let's take a bean with the method setSomething(Something<T>) called via
> blueprint with another bean implementing Something => exception saying that
> bean conversion is not possible. But, if I change the method signature
> without the generic type setSomething(Something), then it works as expected.
> Blueprint should not care for the generic type as Java is type erasure and do
> not exceed the spec.
> There is no nice work around. Have to change all APIs used via Blueprint and
> take note for all deviations. This is really heavy.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)