diff --git a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java index c1e01c17e40..e0b2f83a1b4 100644 --- a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java +++ b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java @@ -317,14 +317,13 @@ final class DefaultIndexingChain extends DocConsumer { indexDocValue(fp, dvType, field); } } + storedFieldsWriter.finishDocument(); success = true; } finally { if (success == false) { // We must abort, on the possibility that the // stored fields file is now corrupt: docWriter.setAborting(); - } else { - storedFieldsWriter.finishDocument(); } } } diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java index 8144e97a585..fc37aaffb6f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java @@ -427,7 +427,7 @@ public class TestIndexWriterWithThreads extends LuceneTestCase { if (doFail) { StackTraceElement[] trace = new Exception().getStackTrace(); for (int i = 0; i < trace.length; i++) { - if ("flush".equals(trace[i].getMethodName()) && "org.apache.lucene.index.DocFieldProcessor".equals(trace[i].getClassName())) { + if ("flush".equals(trace[i].getMethodName()) && DefaultIndexingChain.class.getName().equals(trace[i].getClassName())) { if (onlyOnce) doFail = false; //System.out.println(Thread.currentThread().getName() + ": NOW FAIL: onlyOnce=" + onlyOnce);