aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <>
Subject [jira] [Resolved] (ARIES-1500) Fix wildcard types support
Date Tue, 06 Sep 2016 18:09:21 GMT


Guillaume Nodet resolved ARIES-1500.
    Resolution: Fixed

Blueprint does strict checking.  In your example, there's no way to ensure you won't run into
a ClassCastException, so blueprint refuses to inject.  If you change the constructor to accept
a WritableValue instead of WritableValue<String>, then it will work fine.

Also, in this very case, you can use the WritableStringValue and a bean of type SimpleStringProperty
You could also use a custom converter.

I think our implementation goes way beyond what the OSGi spec says.  I think if we want to
go beyond, i.e. allow non enforceable casts, we need a flag somewhere to turn on this feature.
 If you want to provide a patch to go that way, please open a new jira.

> Fix wildcard types support
> --------------------------
>                 Key: ARIES-1500
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: blueprint-core-1.5.0
>         Environment: All
>            Reporter: Jean-Philippe CLEMENT
>            Assignee: Guillaume Nodet
>             Fix For: blueprint-core-1.6.0
>         Attachments: org.apache.aries.blueprint.core-1.6.0-SNAPSHOT.jar
> 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

View raw message