You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2013/09/24 00:26:05 UTC

svn commit: r1525721 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/test-framework/ lucene/test-framework/src/java/org/apache/lucene/analysis/MockGraphTokenFilter.java

Author: rmuir
Date: Mon Sep 23 22:26:04 2013
New Revision: 1525721

URL: http://svn.apache.org/r1525721
Log:
don't throw NPE if someone consumes us wrong, also null out random on close to be pickier

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/analysis/MockGraphTokenFilter.java

Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/analysis/MockGraphTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/analysis/MockGraphTokenFilter.java?rev=1525721&r1=1525720&r2=1525721&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/analysis/MockGraphTokenFilter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/analysis/MockGraphTokenFilter.java Mon Sep 23 22:26:04 2013
@@ -105,10 +105,19 @@ public final class MockGraphTokenFilter 
   }
 
   @Override
+  public void close() throws IOException {
+    super.close();
+    this.random = null;
+  }
+
+  @Override
   public boolean incrementToken() throws IOException {
     if (DEBUG) {
       System.out.println("MockGraphTF.incr inputPos=" + inputPos + " outputPos=" + outputPos);
     }
+    if (random == null) {
+      throw new IllegalStateException("incrementToken called in wrong state!");
+    }
     return nextToken();
   }
 }