lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r818913 - /lucene/java/trunk/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
Date Fri, 25 Sep 2009 16:34:22 GMT
Author: uschindler
Date: Fri Sep 25 16:34:22 2009
New Revision: 818913

URL: http://svn.apache.org/viewvc?rev=818913&view=rev
Log:
LUCENE-1926: Add an extra clearAttributes in assertTokenStreamContents

Modified:
    lucene/java/trunk/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java

Modified: lucene/java/trunk/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java?rev=818913&r1=818912&r2=818913&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/analysis/BaseTokenStreamTestCase.java Fri
Sep 25 16:34:22 2009
@@ -111,6 +111,7 @@
     
     ts.reset();
     for (int i = 0; i < output.length; i++) {
+      ts.clearAttributes(); // extra safety to enforce, that the state is not preserved
       assertTrue("token "+i+" exists", ts.incrementToken());
       assertEquals("term "+i, output[i], termAtt.term());
       if (startOffsets != null)
@@ -123,6 +124,7 @@
         assertEquals("posIncrement "+i, posIncrements[i], posIncrAtt.getPositionIncrement());
     }
     assertFalse("end of stream", ts.incrementToken());
+    ts.end();
     ts.close();
   }
   



Mime
View raw message