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

PropertyStates#createProperty ignores namespace mappings when creating states of type NAME and PATH

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.6
    • core
    • None

    Description

      as far as i saw we use PropertyStates#createProperty to create and
      set an OAK property from a given JCR value or a list of JCR values.

      this works well for all types of values except for NAME, PATH which
      may contain values with remapped namespaces which will not be converted
      back to oak-values during the state creation:

           List<String> vals = Lists.newArrayList();
           for (Value value : values) {
               vals.add(value.getString());
           }
           return new MultiGenericPropertyState(name, vals, Type.fromTag(type, true));
      

      if am not mistaken

      value.getString()

      will return the JCR
      representation of the value instead of the oak representation as it
      would be needed here.

      possible solutions include:

      • passing namepathmapper to the create method
      • only accept oak Value implementation that allows to retrieve the
        internal representation, which is present in the ValueImpl afaik.

      Attachments

        Activity

          People

            mduerig Michael Dürig
            angela Angela Schreiber
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: