lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Tamm (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-508) SegmentTermEnum.next() doesn't maintain prevBuffer at end
Date Mon, 07 Jan 2008 21:42:34 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556717#action_12556717
] 

Steven Tamm commented on LUCENE-508:
------------------------------------

Thanks!

-Steven



> SegmentTermEnum.next() doesn't maintain prevBuffer at end
> ---------------------------------------------------------
>
>                 Key: LUCENE-508
>                 URL: https://issues.apache.org/jira/browse/LUCENE-508
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>    Affects Versions: 1.9, 2.0.0
>         Environment: Lucene Trunk
>            Reporter: Steven Tamm
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.3
>
>
> When you're iterating a SegmentTermEnum and you go past the end of the docs, you end
up with a state where the nextBuffer = null and the prevBuffer is the penultimate term, not
the last term.  This patch fixes it.  (It's also required for my Prefetching bug [LUCENE-506])
> Index: java/org/apache/lucene/index/SegmentTermEnum.java
> ===================================================================
> --- java/org/apache/lucene/index/SegmentTermEnum.java	(revision 382121)
> +++ java/org/apache/lucene/index/SegmentTermEnum.java	(working copy)
> @@ -109,6 +109,7 @@
>    /** Increments the enumeration to the next element.  True if one exists.*/
>    public final boolean next() throws IOException {
>      if (position++ >= size - 1) {
> +      prevBuffer.set(termBuffer);
>        termBuffer.reset();
>        return false;
>      }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message