[
https://issues.apache.org/jira/browse/SLING-6341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15705906#comment-15705906
]
Santiago García Pimentel commented on SLING-6341:
-------------------------------------------------
the docs at
http://sling.apache.org/documentation/bundles/models.html#available-injectors
list the injector as supporting arrays, so this is clearly a bug.
> ResourcePath injector does not correctly wraps to array
> -------------------------------------------------------
>
> Key: SLING-6341
> URL: https://issues.apache.org/jira/browse/SLING-6341
> Project: Sling
> Issue Type: Bug
> Affects Versions: Sling Models Impl 1.2.2
> Reporter: Santiago García Pimentel
>
> In a sling model, when injecting resources from the resourcePath injector, if
> you declare the injected field as an array, the injection will fail.
> Injection works fine if you declare the field as a list.
> to verify.
> Have a resource which holds a property with a path to other resource.
> Have the following injection:
>
> @ResourcePath(path = "/content/test/node")
> private Resource[] pathProperty;
> I get the following:
> org.apache.sling.models.factory.ModelClassException: Could not adapt from
> class org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource to
> class [Lorg.apache.sling.api.resource.Resource;
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)