jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Parvulescu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (JCR-3401) Wrong results when querying with a DescendantSelfAxisQuery
Date Mon, 13 Aug 2012 13:06:38 GMT

     [ https://issues.apache.org/jira/browse/JCR-3401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alex Parvulescu updated JCR-3401:
---------------------------------

    Fix Version/s: 2.4.3

backported to 2.4 with rev 1372412.
                
> 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├ędric Damioli
>            Assignee: Alex Parvulescu
>             Fix For: 2.4.3, 2.6
>
>         Attachments: DescendantSelfAxisQuery.java.patch, SimpleDescendantSelfAxisTest.java
>
>
> It seems to be caused by the DescendantSelfAxisScorer in the method advance(int target)
:
> {code}
>         public int advance(int target) throws IOException {
>             if (currentDoc == 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 == NO_MORE_DOCS) {
>                 subScorer.advance(target);
>                 currentDoc = NO_MORE_DOCS;
>                 return currentDoc;
>             }
>             currentDoc = subScorer.nextDoc();
>             if (currentDoc == NO_MORE_DOCS) {
>                 return NO_MORE_DOCS;
>             } else {
>                 collectContextHits();
>                 return isValid(currentDoc) ? currentDoc : nextDoc();
>             }
>         }
> {code}
> It seems to me that we should have: 
> {code}
> currentDoc = subScorer.advance(target) 
> {code}
> instead of: 
> {code}
> currentDoc = subScorer.nextDoc();
> {code}
> I could provide a patch but I don't know if this is necessary for a single line of code.
> Moreover, I don't know if my fix is ok, as I'm not sure to fully understand the whole
picture.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message