Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-1302

ArrayHits does not end properly when skipTo doesn't find document

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: jackrabbit-core, query
    • Labels:
      None

      Description

      If skipTo(target) does not find a document that that has a higher value than the target, it falls out of the loop and calls next() possibly returning a previously found document. The patch makes sure that -1 is returned in this case, otherwise confusing results might occur.

      Index: src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ArrayHits.java
      ===================================================================
      — src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ArrayHits.java (revision 608900)
      +++ src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ArrayHits.java (working copy)
      @@ -87,9 +87,9 @@
      int nextDocValue = hits[i];
      if (nextDocValue >= target)

      { index = i; - break; + return next(); }

      }

      • return next();
        + return -1;
        }
        }

        Attachments

          Activity

            People

            • Assignee:
              ckiehl Christoph Kiehl
              Reporter:
              robowen Rob Owen

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment