You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Jean-Philippe CLEMENT (JIRA)" <ji...@apache.org> on 2016/09/06 16:47:20 UTC

[jira] [Comment Edited] (ARIES-1500) Fix wildcard types support

    [ https://issues.apache.org/jira/browse/ARIES-1500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15467874#comment-15467874 ] 

Jean-Philippe CLEMENT edited comment on ARIES-1500 at 9/6/16 4:46 PM:
----------------------------------------------------------------------

Let's say I have a bean like this:
public final class MyBean {
 public MyBean(final WritableValue<String> value) {
  ...
 }

And in the blueprint:
<bean id="myValue" class="javafx.beans.property.SimpleObjectProperty"/>
<bean id="willFail" class="test.MyBean">
 <argument ref="myValue"/>
</bean>

Then the inection of myValue in willFail... fails!

But if MyBean is like this:
 public MyBean(final WritableValue value) { ... }

Then the injection works fine. There is no way to specify generic type in blueprint and as expressed before, after compilation WritableValue<String> and WritableValue are the same for the JVM.

I would suggest blueprint to stop checking the generic type and react like the JVM (i.e. WritableValue<String> is WritableValue) :)


was (Author: jeanphi):
Let's say I have a bean like this:
public final class MyBean {
 public MyBean(final WritableValue<String> value) {
  ...
 }

And in the blueprint:
<bean id="myValue" class="javafx.beans.property.SimpleObjectProperty"/>
<bean id="willFail" class="test.MyBean">
 <argument ref="myValue"/>
</bean>

Then the inection of myValue in willFail... fails!

But if MyBean is like this:
 public MyBean(final WritableValue value) { ... }

Then the injection works fine. There is no way to specify generic type in blueprint and as expressed before, after compilation WritableValue<String> and WritableValue are the same for the JVM.

I would suggest blueprint to stop checking the generic type and react like the JVM (type erasure) :)

> Fix wildcard types support
> --------------------------
>
>                 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
>            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
(v6.3.4#6332)