### Eclipse Workspace Patch 1.0 #P jackrabbit-core Index: src/main/java/org/apache/jackrabbit/core/query/lucene/DocOrderScoreNodeIterator.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/query/lucene/DocOrderScoreNodeIterator.java (revision 1822206) +++ src/main/java/org/apache/jackrabbit/core/query/lucene/DocOrderScoreNodeIterator.java (working copy) @@ -220,8 +220,13 @@ // check if either path is an ancestor of the other if (path1.length - 1 == commonDepth) { - // path1 itself is ancestor of path2 - return -1; + if (path2.length - 1 == commonDepth) { + // same path (avoid IllegalArgumentException: Comparison method violates its general contract!) + return 0; + } else { + // path1 itself is ancestor of path2 + return -1; + } } if (path2.length - 1 == commonDepth) { // path2 itself is ancestor of path1