lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1446145 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/test-framework/ lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingTermVectorsFormat.java
Date Thu, 14 Feb 2013 12:35:39 GMT
Author: rmuir
Date: Thu Feb 14 12:35:39 2013
New Revision: 1446145

URL: http://svn.apache.org/r1446145
Log:
don't assert in close(), check docCount in finish()

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingTermVectorsFormat.java

Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingTermVectorsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingTermVectorsFormat.java?rev=1446145&r1=1446144&r2=1446145&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingTermVectorsFormat.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingTermVectorsFormat.java
Thu Feb 14 12:35:39 2013
@@ -80,7 +80,7 @@ public class AssertingTermVectorsFormat 
   static class AssertingTermVectorsWriter extends TermVectorsWriter {
     private final TermVectorsWriter in;
     private Status docStatus, fieldStatus, termStatus;
-    private int fieldCount, termCount, positionCount;
+    private int docCount, fieldCount, termCount, positionCount;
     boolean hasPositions;
 
     AssertingTermVectorsWriter(TermVectorsWriter in) {
@@ -98,6 +98,7 @@ public class AssertingTermVectorsFormat 
       in.startDocument(numVectorFields);
       docStatus = Status.STARTED;
       fieldCount = numVectorFields;
+      docCount++;
     }
 
     @Override
@@ -167,6 +168,7 @@ public class AssertingTermVectorsFormat 
 
     @Override
     public void finish(FieldInfos fis, int numDocs) throws IOException {
+      assert docCount == numDocs;
       assert docStatus == (numDocs > 0 ? Status.FINISHED : Status.UNDEFINED);
       assert fieldStatus != Status.STARTED;
       assert termStatus != Status.STARTED;
@@ -181,9 +183,6 @@ public class AssertingTermVectorsFormat 
     @Override
     public void close() throws IOException {
       in.close();
-      assert docStatus != Status.STARTED;
-      assert fieldStatus != Status.STARTED;
-      assert termStatus != Status.STARTED;
     }
 
   }



Mime
View raw message