Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 809D6DC82 for ; Tue, 4 Sep 2012 08:23:10 +0000 (UTC) Received: (qmail 66928 invoked by uid 500); 4 Sep 2012 08:23:09 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 66859 invoked by uid 500); 4 Sep 2012 08:23:09 -0000 Mailing-List: contact dev-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 dev@jackrabbit.apache.org Received: (qmail 66766 invoked by uid 99); 4 Sep 2012 08:23:09 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2012 08:23:09 +0000 Date: Tue, 4 Sep 2012 19:23:09 +1100 (NCT) From: "Bart van der Schans (JIRA)" To: dev@jackrabbit.apache.org Message-ID: <1668293947.31835.1346746989794.JavaMail.jiratomcat@arcas> In-Reply-To: <1388623782.122181.1343754754688.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Closed] (JCR-3401) Wrong results when querying with a DescendantSelfAxisQuery MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-3401?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Bart van der Schans closed JCR-3401. ------------------------------------ =20 > Wrong results when querying with a DescendantSelfAxisQuery > ---------------------------------------------------------- > > Key: JCR-3401 > URL: https://issues.apache.org/jira/browse/JCR-3401 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-core, query > Affects Versions: 2.3.7, 2.4.2, 2.5 > Reporter: C=C3=A9dric Damioli > Assignee: Alex Parvulescu > Fix For: 2.4.3, 2.6 > > Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendant= SelfAxisTest.java > > > It seems to be caused by the DescendantSelfAxisScorer in the method advan= ce(int target) : > {code} > public int advance(int target) throws IOException { > if (currentDoc =3D=3D NO_MORE_DOCS) { > return currentDoc; > } > // optimize in the case of an advance to finish. > // see https://issues.apache.org/jira/browse/JCR-3082 > if (target =3D=3D NO_MORE_DOCS) { > subScorer.advance(target); > currentDoc =3D NO_MORE_DOCS; > return currentDoc; > } > currentDoc =3D subScorer.nextDoc(); > if (currentDoc =3D=3D NO_MORE_DOCS) { > return NO_MORE_DOCS; > } else { > collectContextHits(); > return isValid(currentDoc) ? currentDoc : nextDoc(); > } > } > {code} > It seems to me that we should have:=20 > {code} > currentDoc =3D subScorer.advance(target)=20 > {code} > instead of:=20 > {code} > currentDoc =3D subScorer.nextDoc(); > {code} > I could provide a patch but I don't know if this is necessary for a singl= e line of code. > Moreover, I don't know if my fix is ok, as I'm not sure to fully understa= nd the whole picture. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira