jsr-333
  1. jsr-333
  2. JSR_333-41

make javadoc of Property.setValue(Value value) more explicit

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: spec
    • Labels:
      None

      Description

      the javadoc [1] tells that "If the property type is constrained, then a best-effort conversion is attempted." however, the jcr 2.0 specification defines in 3.6.4 [2] an exact list of what can be converted into which types and when to throw the ValueFormatException.

      the best-effort conversion suggerates that the implementation might convert more of the cases or "just does something" like convert string "hello" to integer 1. according to stefan guggisberg, this is not the intention. best-effort in this case means that a conversion is attempted but it's not guaranteed to succeed.

      i suggest referencing the spec at paragraph 3.6.4 in the javadoc to be exact what behaviour to expect. something like "...then a conversion according to JCR specification, paragraph 3.6.4 is attempted."

      if the implementations don't follow the exact same rules, this will result in non-portable client code because what works with one implementation works not with an other.

      see also https://github.com/phpcr/phpcr-api-tests/issues/27

        Activity

        Hide
        dbu added a comment -

        similar comments are on Node.setProperty(string, Value) as well.

        Show
        dbu added a comment - similar comments are on Node.setProperty(string, Value) as well.
        Hide
        Peeter Piegaze added a comment -

        CHanges made to Property.setValue and Node.setProperty Javadoc as suggested

        Show
        Peeter Piegaze added a comment - CHanges made to Property.setValue and Node.setProperty Javadoc as suggested
        Hide
        dbu added a comment -

        thanks peter

        Show
        dbu added a comment - thanks peter

          People

          • Assignee:
            Unassigned
            Reporter:
            dbu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: