jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1179129 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DescendantSelfAxisQuery.java
Date Wed, 05 Oct 2011 09:52:54 GMT
Author: alexparvulescu
Date: Wed Oct  5 09:52:53 2011
New Revision: 1179129

URL: http://svn.apache.org/viewvc?rev=1179129&view=rev
Log:
JCR-3082 occasional index out of bounds exception while running UserManagerImplTest.testFindAuthorizableByRelativePath

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DescendantSelfAxisQuery.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DescendantSelfAxisQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DescendantSelfAxisQuery.java?rev=1179129&r1=1179128&r2=1179129&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DescendantSelfAxisQuery.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DescendantSelfAxisQuery.java
Wed Oct  5 09:52:53 2011
@@ -502,6 +502,14 @@ class DescendantSelfAxisQuery extends Qu
                 return currentDoc;
             }
 
+            // optimize in the case of an advance to finish.
+            // see https://issues.apache.org/jira/browse/JCR-3082
+            if (target == NO_MORE_DOCS) {
+                subScorer.advance(target);
+                currentDoc = NO_MORE_DOCS;
+                return currentDoc;
+            }
+
             currentDoc = subScorer.nextDoc();
             if (currentDoc == NO_MORE_DOCS) {
                 return NO_MORE_DOCS;



Mime
View raw message