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

orderBefore causes NPE when ordering xml-imported nodes

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: