lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Tamm (JIRA)" <>
Subject [jira] Created: (LUCENE-508) doesn't maintain prevBuffer at end
Date Thu, 02 Mar 2006 03:06:40 GMT doesn't maintain prevBuffer at end

         Key: LUCENE-508
     Project: Lucene - Java
        Type: Bug
  Components: Index  
    Versions: 1.9, 2.0    
 Environment: Lucene Trunk
    Reporter: Steven Tamm

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/
--- java/org/apache/lucene/index/	(revision 382121)
+++ java/org/apache/lucene/index/	(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);
       return false;

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message