costin commented on code in PR #16144:
URL: https://github.com/apache/lucene/pull/16144#discussion_r3324626347
##########
lucene/test-framework/src/java/org/apache/lucene/tests/search/AssertingLeafCollector.java:
##########
@@ -47,7 +50,37 @@ class AssertingLeafCollector extends FilterLeafCollector {
@Override
public void setScorer(Scorable scorer) throws IOException {
- super.setScorer(AssertingScorable.wrap(scorer));
+ Scorable wrappedScorer = AssertingScorable.wrap(scorer);
+ if (wrappedScorer instanceof Scorer wrappedScorerAsScorer) {
+ super.setScorer(
+ new FilterScorer(wrappedScorerAsScorer) {
+ @Override
+ public float score() throws IOException {
+ assert batchCollectionDepth == 0
Review Comment:
A blanket guard would make valid scorables fail because the contract issue
is about iterator-backed scorer positioning. I've added a short comment
explaining this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]