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

VersionManager#isCheckedOut throws IllegalStateException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9
    • core, jcr
    • None

    Description

      the currently implementation of VersionManager#isCheckedOut will throws
      IllegalStateException if the node at the specified path is not versionable and the root node is not accessible to the editing session.

      the issue is caused by the implementation of ReadOnlyVersionManager#isCheckedOut
      which looks as follows:

      if (checkNotNull(tree).exists()) {
                  PropertyState p = tree.getProperty(VersionConstants.JCR_ISCHECKEDOUT);
                  if (p != null) {
                      return p.getValue(Type.BOOLEAN);
                  } else if (tree.isRoot()) {
                      return true;
                  }
              } else {
                  // FIXME: this actually means access to the tree is restricted
                  // and may result in wrong isCheckedOut value. This should never
                  // be the case in a commit hook because it operates on non-access-
                  // controlled NodeStates. This means consistency is not at risk
                  // but it may mean oak-jcr sees a node as checked out even though
                  // it is in fact read-only because of a checked-in ancestor.
              }
              // otherwise return checkedOut status of parent
              return isCheckedOut(tree.getParent());
      

      in fact: in case of the failing calling the code hits the FIXME.
      IMHO the underlying problem is caused by the fact that the versionmanager operates on the access controlled tree instances instead of relying on low level NodeState or ImmutableTree.

      i will commit a test case illustrating the problem.

      Attachments

        Issue Links

          Activity

            People

              mreutegg Marcel Reutegger
              angela Angela Schreiber
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: