You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2008/09/17 15:49:44 UTC

[jira] Resolved: (SLING-662) ValueMap#get(java.lang.String name, T defaultValue) should support arrays transparently

     [ https://issues.apache.org/jira/browse/SLING-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved SLING-662.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: JCR Resource 2.0.4

Committed an ehancement in Rev. 696291 as follows:

* If the property is multivalue and the type is an array an array of converted values is returned
* If the property is multivalue with at least one value and the type is not an array, the first value is returned
* If the property is multivalue with no values, null is returned
* If the property is single-value and the type is an array a single element array is returned
* If the property is single-value and the type is not an array, the converted value is returned

Please close this issue, if this is ok for you. Thanks.

> ValueMap#get(java.lang.String name, T defaultValue) should support arrays transparently
> ---------------------------------------------------------------------------------------
>
>                 Key: SLING-662
>                 URL: https://issues.apache.org/jira/browse/SLING-662
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR Resource
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.4
>
>
> when calling ValueMap.get("name", String[].class) and empty array is returned if the underlying jcr property is not
> multivalued. this is very inconvenient.
> imo get() for arrays or single values should work transparently regardless of the underlying property multivalueness.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.