From 1a191f4edc978dd2e7be2f30b0998caa7b68fc0f Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Wed, 21 Mar 2012 15:22:28 +0000 Subject: [PATCH] LUCENE-3898: reset() was missing some state git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1303441 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/analysis/synonym/SynonymFilter.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilter.java b/modules/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilter.java index f55eb533ce7..b0dd7073336 100644 --- a/modules/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilter.java +++ b/modules/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymFilter.java @@ -609,11 +609,14 @@ public final class SynonymFilter extends TokenFilter { super.reset(); captureCount = 0; finished = false; + inputSkipCount = 0; + nextRead = nextWrite = 0; // In normal usage these resets would not be needed, // since they reset-as-they-are-consumed, but the app - // may not consume all input tokens in which case we - // have leftover state here: + // may not consume all input tokens (or we might hit an + // exception), in which case we have leftover state + // here: for (PendingInput input : futureInputs) { input.reset(); }