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

Join criteria that involves a null or nonexistent property on the left-hand side will result in NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.7.0.Final, 3.0.0.Alpha1
    • 2.6.0.Final
    • Query
    • None

      Using a join query with a join condition that may involve a null value (because the property isn't a mandatory property), and this causes the nested loop merge logic to throw a NullPointerException:

      java.lang.NullPointerException
        at org.modeshape.graph.query.process.JoinComponent$6.evaluate(JoinComponent.java:359)
        at org.modeshape.graph.query.process.NestedLoopJoinComponent.execute(NestedLoopJoinComponent.java:68)
        at org.modeshape.graph.query.process.ProjectComponent.execute(ProjectComponent.java:48)
        at org.modeshape.graph.query.process.QueryProcessor.execute(QueryProcessor.java:100)
        at org.modeshape.graph.query.QueryEngine.execute(QueryEngine.java:124)
        at org.modeshape.jcr.RepositoryQueryManager$SelfContained.query(RepositoryQueryManager.java:435)
        at org.modeshape.jcr.JcrQueryManager$SessionQueryContext.execute(JcrQueryManager.java:1422)
        at org.modeshape.jcr.query.JcrQuery.execute(JcrQuery.java:103)
        ...
      

      Here is a sample query:

      SELECT grantee.* 
      FROM [tt:friendly] as grantor INNER JOIN [tt:friendly] as grantee 
      ON grantor.[tt:friend] = grantee.[jcr:uuid] 
      

      Note that any tt:friendly nodes that don't have a tt:friend property will cause the left-hand side for that tuple to be null, and this causes the NPE when the join criteria is evaluated.

              rhauch Randall Hauch (Inactive)
              rhauch Randall Hauch (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: