-
Bug
-
Resolution: Done
-
Major
-
2.6.0.Final
-
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.