lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r652162 - in /lucene/java/branches/lucene_2_3/src: java/org/apache/lucene/index/DocumentsWriter.java test/org/apache/lucene/index/TestIndexWriter.java
Date Tue, 29 Apr 2008 21:51:03 GMT
Author: mikemccand
Date: Tue Apr 29 14:51:03 2008
New Revision: 652162

URL: http://svn.apache.org/viewvc?rev=652162&view=rev
Log:
LUCENE-1255: revert this change (allow pos=-1 again) since it's not backwards compatible

Modified:
    lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java
    lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/index/TestIndexWriter.java

Modified: lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java?rev=652162&r1=652161&r2=652162&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java
(original)
+++ lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/DocumentsWriter.java
Tue Apr 29 14:51:03 2008
@@ -1522,9 +1522,6 @@
               Token token = stream.next(localToken);
               if (token == null) break;
               position += (token.getPositionIncrement() - 1);
-              // LUCENE-1255: don't allow negative positon
-              if (position < 0)
-                position = 0;
               addPosition(token);
               if (++length >= maxFieldLength) {
                 if (infoStream != null)

Modified: lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=652162&r1=652161&r2=652162&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/index/TestIndexWriter.java
(original)
+++ lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/index/TestIndexWriter.java
Tue Apr 29 14:51:03 2008
@@ -3029,7 +3029,7 @@
     TermPositions tps = s.getIndexReader().termPositions(new Term("field", "a"));
     assertTrue(tps.next());
     assertEquals(1, tps.freq());
-    assertEquals(0, tps.nextPosition());
+    assertEquals(-1, tps.nextPosition());
 
     assertTrue(_TestUtil.checkIndex(dir));
     s.close();



Mime
View raw message