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

Node.setProperty(String, Value) fails for binary non ValueImpls

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.8, 1.1.0
    • None
    • None

    Description

      JCRVLT-58 reports an issue where "copying" of a JCR value fails,
      because the source and destination repository implementation are
      different.

      so basically:

      s1 = repository1.login(); // remote repository via davex
      s2 = repository2.login(); // local oak repository
      
      p1 = s1.getProperty(....);
      n2 = s2.getNode(....);
      
      n2.setProperty(p1.getName(), p1.getValue());
      

      AFAICT, this usually works but not for binary values. it eventually fails in:

      org.apache.jackrabbit.oak.plugins.value.ValueImpl#getBlob(javax.jcr.Value)
      
          public static Blob getBlob(Value value) {
              checkState(value instanceof ValueImpl);
              return ((ValueImpl) value).getBlob();
          }
      

      ...because the value is not a ValueImpl but a QValue.

      IMO, this should work, even if the value is not a ValueImpl. In this
      case, it should fall back to the API methods to read the binary.

      Attachments

        Issue Links

          Activity

            People

              mduerig Michael Dürig
              tripod Tobias Bocanegra
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: