You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2025/05/20 21:10:55 UTC
(lucene) branch main updated: Implement AssertingPostingsEnum#intoBitSet. (#14675)
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new 341733f591f Implement AssertingPostingsEnum#intoBitSet. (#14675)
341733f591f is described below
commit 341733f591f782f9b40a126c7e20f30f8f12cb84
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Tue May 20 23:10:50 2025 +0200
Implement AssertingPostingsEnum#intoBitSet. (#14675)
This improves test coverage a bit.
---
.../apache/lucene/tests/index/AssertingLeafReader.java | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingLeafReader.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingLeafReader.java
index c56f880c089..6d4b6b56478 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingLeafReader.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingLeafReader.java
@@ -578,6 +578,24 @@ public class AssertingLeafReader extends FilterLeafReader {
return payload;
}
+ @Override
+ public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws IOException {
+ assertThread("Docs enums", creationThread);
+ assert state != DocsEnumState.START : "intoBitSet() called before nextDoc()/advance()";
+ in.intoBitSet(upTo, bitSet, offset);
+ assert in.docID() >= upTo;
+ assert in.docID() >= doc;
+ doc = in.docID();
+ if (doc == DocIdSetIterator.NO_MORE_DOCS) {
+ state = DocsEnumState.FINISHED;
+ positionMax = 0;
+ } else {
+ state = DocsEnumState.ITERATING;
+ positionMax = super.freq();
+ }
+ positionCount = 0;
+ }
+
void reset() {
state = DocsEnumState.START;
doc = in.docID();