diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java index 9e0a1d0df20..ad827317d1f 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java @@ -1018,6 +1018,7 @@ public class TestIndexWriter extends LuceneTestCase { doc.add(newStringField(random, "id", "500", Field.Store.NO)); doc.add(newField(random, "field", "some prepackaged text contents", storedTextType)); w.addDocument(doc); + doc = new Document(); doc.add(newStringField(random, "id", "501", Field.Store.NO)); doc.add(newField(random, "field", "some more contents", storedTextType)); w.addDocument(doc);