You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2012/07/25 10:25:35 UTC
[jira] [Commented] (ARIES-834) Unable to convert value
ListIndexIterable to type java.lang.Iterable
[ https://issues.apache.org/jira/browse/ARIES-834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422082#comment-13422082 ]
Guillaume Nodet commented on ARIES-834:
---------------------------------------
This is slightly off the spec, as section 121.9.3 of the enterprise spec specifies:
The goal of the type conversion is to convert a source object s with type S to a target type T<P1..Pn>. The conversion of the Blueprint built-in type converter must take place in the following order:
#1. If T < P 1 . . P n > is assignable from S , which implies n=0, then no conversion is necessary, except that primitives must be converted to their wrapper types.
The problem here, is that the assertion "which implies n=0" isn't completely true, if S extends or implements T<P1..Pn>.
> Unable to convert value ListIndexIterable to type java.lang.Iterable<Something>
> -------------------------------------------------------------------------------
>
> Key: ARIES-834
> URL: https://issues.apache.org/jira/browse/ARIES-834
> Project: Aries
> Issue Type: Bug
> Components: Blueprint
> Environment: Karaf 2.2.5, Blueprint 0.3.1, Neo4j 1.7-SNAPSHOT (my own fork)
> Reporter: Hendy Irawan
>
> The property :
> {code}
> public void setIndexIterable(Iterable<IndexProvider> indexIterable) {
> this.indexIterable = indexIterable;
> }
> {code}
> The implementation :
> {code}
> public class ListIndexIterable implements Iterable<IndexProvider>
> {code}
> The Blueprint :
> {code}
> <bean id="listIndexIterable" class="org.neo4j.kernel.ListIndexIterable">
> <property name="indexProviders">
> <reference-list interface="org.neo4j.graphdb.index.IndexProvider"
> availability="optional"/>
> </property>
> </bean>
> <bean id="graphDatabaseFactory" class="org.neo4j.kernel.DefaultGraphDatabaseFactory">
> <property name="indexIterable" ref="listIndexIterable"/>
> </bean>
> {code}
> Expected result : works because ListIndexIterable implements Iterable<IndexProvider>
> Actual result :
> {code}
> Caused by: java.lang.Exception: Unable to convert value org.neo4j.kernel.ListIndexIterable@674df816 to type java.lang.Iterable<org.neo4j.graphdb.index.IndexProvider>
> at org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:172)[9:org.apache.aries.blueprint:0.3.1]
> at org.apache.aries.blueprint.container.BlueprintRepository.convert(BlueprintRepository.java:373)[9:org.apache.aries.blueprint:0.3.1]
> at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.convert(ReflectionUtils.java:323)[9:org.apache.aries.blueprint:0.3.1]
> at org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.internalSet(ReflectionUtils.java:476)[9:org.apache.aries.blueprint:0.3.1]
> at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(ReflectionUtils.java:307)[9:org.apache.aries.blueprint:0.3.1]
> at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:805)[9:org.apache.aries.blueprint:0.3.1]
> ... 17 more
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira