Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-184

Allow PropertyState.getValues() to work on single-valued properties

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.4
    • core
    • None

    Description

      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.

      Attachments

        Activity

          People

            jukkaz Jukka Zitting
            jukkaz Jukka Zitting
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: