Apache Lucene open-source search software
fix reuse bug
Robert Muir18587e58c9c2
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.javaindex 042a3f36f2d..e0bab97dcd6 100644--- a/lucene/core/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java+++ b/lucene/core/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java@@ -1852,7 +1852,7 @@ public class DirectPostingsFormat extends PostingsFormat {public DocsEnum reset(int[] docIDs, int[] freqs) {this.docIDs = docIDs;this.freqs = freqs;- upto = -1;+ docID = upto = -1;return this;}diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPostingsFormat.java b/lucene/core/src/test/org/apache/lucene/index/TestPostingsFormat.javaindex 00e69db9c9c..d1c59c67075 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestPostingsFormat.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestPostingsFormat.java@@ -554,7 +554,7 @@ public class TestPostingsFormat extends LuceneTestCase {assertNotNull("null DocsEnum", docsEnum);int initialDocID = docsEnum.docID();- assertTrue("inital docID should be -1 or NO_MORE_DOCS", initialDocID == -1 || initialDocID == DocsEnum.NO_MORE_DOCS);+ assertTrue("inital docID should be -1 or NO_MORE_DOCS: " + docsEnum, initialDocID == -1 || initialDocID == DocsEnum.NO_MORE_DOCS);if (VERBOSE) {if (prevDocsEnum == null) {