jsr-283
  1. jsr-283
  2. JSR_283-811

nt:propertyDefinition has incorrect value constraints for property types

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: not determined
    • Fix Version/s: None
    • Component/s: node types
    • Labels:
      None

      Description

      Discovered by Michael Dürig:

      [nt:propertyDefinition]
      ...

      • jcr:requiredType (STRING) protected mandatory
        < 'STRING', 'URI', 'BINARY', 'LONG', 'DOUBLE',
        'DECIMAL', 'BOOLEAN', 'DATE', 'NAME', 'PATH',
        'REFERENCE', 'WEAKREFERENCE', 'UNDEFINED'

      The type names are defined in javax.jcr.PropertyType. For example

      TYPENAME_STRING = "String";

      Now JSR-283 says about string constraints (3.7.3.6.1): "For STRING and URI properties, the constraint string is a regular expression pattern according to the syntax of java.util.regex.Pattern."

      So jcr:requiredType can be for example "STRING" but not "String". The former however results in an IllegalArgumentException when passed to PropertyType.valueFromName().

      It appears the simplest possible fix would be to tune the type names in the value constraints.

        Activity

        reschke created issue -
        reschke made changes -
        Field Original Value New Value
        Summary nt:propertyDefinition has incorrect value constrains for property types nt:propertyDefinition has incorrect value constraints for property types

          People

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

            Dates

            • Created:
              Updated: