lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1349622 - /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsWriter.java
Date Wed, 13 Jun 2012 03:04:35 GMT
Author: rmuir
Date: Wed Jun 13 03:04:35 2012
New Revision: 1349622

URL: http://svn.apache.org/viewvc?rev=1349622&view=rev
Log:
fix bad assert

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsWriter.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsWriter.java?rev=1349622&r1=1349621&r2=1349622&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsWriter.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsWriter.java
Wed Jun 13 03:04:35 2012
@@ -104,7 +104,7 @@ class SimpleTextFieldsWriter extends Fie
     private final boolean writeOffsets;
 
     // for assert:
-    private int lastEndOffset = -1;
+    private int lastStartOffset = 0;
 
     public SimpleTextPostingsWriter(FieldInfo field) {
       this.indexOptions = field.getIndexOptions();
@@ -133,7 +133,7 @@ class SimpleTextFieldsWriter extends Fie
         newline();
       }
 
-      lastEndOffset = -1;
+      lastStartOffset = 0;
     }
     
     public PostingsConsumer reset(BytesRef term) {
@@ -152,8 +152,8 @@ class SimpleTextFieldsWriter extends Fie
 
       if (writeOffsets) {
         assert endOffset >= startOffset;
-        assert startOffset >= lastEndOffset: "startOffset=" + startOffset + " lastEndOffset="
+ lastEndOffset;
-        lastEndOffset = endOffset;
+        assert startOffset >= lastStartOffset: "startOffset=" + startOffset + " lastStartOffset="
+ lastStartOffset;
+        lastStartOffset = startOffset;
         write(START_OFFSET);
         write(Integer.toString(startOffset));
         newline();



Mime
View raw message