jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OAK-184) Allow PropertyState.getValues() to work on single-valued properties
Date Thu, 12 Jul 2012 14:12:35 GMT
Jukka Zitting created OAK-184:
---------------------------------

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


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

        

Mime
View raw message