Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2504

orderBefore causes NPE when ordering xml-imported nodes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.5.0.Final
    • 4.4.0.Final
    • JCR
    • None

      When one calls orderBefore() on two separately imported nodes, the subsequent call of session.nodeExists() fails on non-existing siblings of these nodes:

      java.lang.NullPointerException
              at org.modeshape.jcr.cache.document.SessionChildReferences.getChild(SessionChildReferences.java:107)
              at org.modeshape.jcr.cache.document.AbstractChildReferences.getChild(AbstractChildReferences.java:50)
              at org.modeshape.jcr.JcrSession.cachedNode(JcrSession.java:622)
              at org.modeshape.jcr.JcrSession.node(JcrSession.java:656)
              at org.modeshape.jcr.JcrSession.node(JcrSession.java:675)
              at org.modeshape.jcr.JcrSession.nodeExists(JcrSession.java:949)
      

      Calling save() immediately after orderBefore() works as a workaround, but one we can't use in our (client) code.

      The code runs fine on Jackrabbit. The patch reproducing the issue is attached.

              hchiorean Horia Chiorean (Inactive)
              rob.s Robert Šiška (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: