You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2012/07/12 17:36:34 UTC

[jira] [Resolved] (OAK-184) Allow PropertyState.getValues() to work on single-valued properties

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

Jukka Zitting resolved OAK-184.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 0.4

Done in revision 1360710, with some followups to optimize internal property representation in revision 1360723.
                
> Allow PropertyState.getValues() to work on single-valued properties
> -------------------------------------------------------------------
>
>                 Key: OAK-184
>                 URL: https://issues.apache.org/jira/browse/OAK-184
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>             Fix For: 0.4
>
>
> Currently the {{PropertyState}} contract specifies that an {{IllegalStateException}} gets thrown if a single-valued property is accessed as a multi-valued one (and vice versa).
> This leads to cumbersome if statements in code that simply wants to go through all the values of a property. To avoid that complexity it would be useful if, instead of throwing an exception, the {{getValues()}} method simply returned an iterable containing the one value of a single-valued property. A client that wants to explicitly check that a property really is multi-valued can still do so simply enough by calling the {{isArray()} method.
> A somewhat similar case can be made also for {{getValue()}} on a multi-valued property, but that's a bit trickier so let's leave it outside the scope of this issue.

--
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