Return-Path: X-Original-To: apmail-jackrabbit-commits-archive@www.apache.org Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 15EBD9311 for ; Wed, 5 Oct 2011 09:53:18 +0000 (UTC) Received: (qmail 83110 invoked by uid 500); 5 Oct 2011 09:53:18 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 83083 invoked by uid 500); 5 Oct 2011 09:53:18 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 83075 invoked by uid 99); 5 Oct 2011 09:53:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2011 09:53:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2011 09:53:15 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 52519238888F; Wed, 5 Oct 2011 09:52:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@jackrabbit.apache.org From: alexparvulescu@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111005095254.52519238888F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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;