From dev-return-35948-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Wed Aug 1 15:31:05 2012 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 7D8C9D16F for ; Wed, 1 Aug 2012 15:31:05 +0000 (UTC) Received: (qmail 57801 invoked by uid 500); 1 Aug 2012 15:31:03 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 57679 invoked by uid 500); 1 Aug 2012 15:31:03 -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 57632 invoked by uid 99); 1 Aug 2012 15:31:03 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2012 15:31:03 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id B1F1A14052C for ; Wed, 1 Aug 2012 15:31:03 +0000 (UTC) Date: Wed, 1 Aug 2012 15:31:03 +0000 (UTC) From: =?utf-8?Q?C=C3=A9dric_Damioli_=28JIRA=29?= To: dev@jackrabbit.apache.org Message-ID: <55704483.1189.1343835063731.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1388623782.122181.1343754754688.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (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 ] C=C3=A9dric Damioli updated JCR-3401: -------------------------------- Attachment: DescendantSelfAxisQuery.java.patch Attached is the proposed fix Note that it makes the optimization introduced by JCR-3082 useless, so I re= moved it in the patch =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.4.2, 2.5 > Reporter: C=C3=A9dric Damioli > Fix For: 2.4.3, 2.5.1, 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira