The sample is a plain code block in the package javadoc, which javadoc never compiles. When the result count moved from an execute argument to setMaxResults, the same commit fixed the two other callers but not this page; a 2012 edit of the sample kept the call and added the : typo.
:, then finds no execute that takes four arguments; the result count now goes through setMaxResults first. Select the still to open it at full size. Generated with AI, checked against the code.- You want to measure search quality on TREC topics, open the
org.apache.lucene.benchmark.qualitypackage overview and copy its "sample code used to run the TREC 2006 queries 701-850". It setsint maxResults = 1000;and callsqrun.execute(maxResults, judge, submitLog, logger). - You expect it to compile and run each query with up to 1000 results.
- Instead javac rejects the call:
required: Judge,SubmissionReport,PrintWriter; found: int,Judge,SubmissionReport,PrintWriter. Copied verbatim, it stops one line earlier still:DirectoryReader.open(directory):ends with:instead of;. - The 4-argument
executeexisted only on trunk, from July 2007 to January 2008: before the 2.3.0 release, the result count moved tosetMaxResults(int);QueryDriverand the tests were updated, the overview never was. Withqrun.setMaxResults(maxResults);followed byqrun.execute(judge, submitLog, logger)the sample compiles.
Developers who start a TREC-style evaluation from the opt-in benchmark module's quality package overview: the copied sample fails to compile every time, on every release since 2.3.0. Documentation only: nothing in Lucene runs differently, and javac names the correct signature.
Mechanism, terms and numbers466 words
The overview of org.apache.lucene.benchmark.quality (an exported package of the published benchmark module) introduces its only code block as "a sample code used to run the TREC 2006 queries 701-850 on the .Gov2 collection". The block sets int maxResults = 1000; and calls qrun.execute(maxResults, judge, submitLog, logger). QualityBenchmark has only execute(Judge, SubmissionReport, PrintWriter) and takes the result count from setMaxResults(int) (default 1000). Copied into a project, the call fails with one javac error, "method execute in class QualityBenchmark cannot be applied to given types; required: Judge,SubmissionReport,PrintWriter; found: int,Judge,SubmissionReport,PrintWriter", on main and on every release from 2.3.0 to 10.6.0. Copied verbatim, javac stops even earlier, because the DirectoryReader.open(directory) line ends with :.
The API change was deliberate: LUCENE-1116 (January 2008; its issue description speaks of moving "control over max-docs-to-retrieve from benchmark constructor to a setter method", though in the code the count was the first argument of execute) added setMaxResults(int) and updated QueryDriver and TestQualityRun, but not the page. 2.3.0, the package's first release, already had the change, so no release ever shipped a compiling sample. A 2012 pass that fixed out-of-date API usage in the sample rewrote its reader lines, left the call and introduced the :. Nothing in Lucene behaves wrongly; only the page is stale.
| line | text | compiles? |
|---|---|---|
| 36 | "Here is a sample code used to run the TREC 2006 queries 701-850 on the .Gov2 collection:" | (prose) |
| 41 | IndexReader ir = DirectoryReader.open(directory): | no: ';' expected |
| 44 | int maxResults = 1000; | yes |
| 63-64 | new QualityBenchmark(qqs, qqParser, searcher, docNameField), SubmissionReport submitLog = null; | yes |
| 65 | QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger); | no: no execute(int, ...) |
| all others | topics and qrels readers, TrecJudge, SimpleQQParser, QualityStats.average, log | yes |
QualityBenchmark has one execute: public QualityStats[] execute(Judge judge, SubmissionReport submitRep, PrintWriter qualityLog) (line 96). It searches with the field maxResults (line 106), documented "maximal number of results to collect for each query. Default: 1000." (lines 63-64) and set by setMaxResults(int) (line 167). A class-file scan of 22 release benchmark jars (2.3.0 to 10.5.2) and main finds no execute(int, ...); all 142 release tags that have the package (2.3.0 to 10.6.0) carry the stale line.
trec/QueryDriver.java:96-98 and TestQualityRun.java:82-86: construct the QualityBenchmark, call qrun.setMaxResults(maxResults), then qrun.execute(judge, submitLog, logger).
Javadoc does not compile <pre><code> blocks, and the block has no {@link} that javadoc would check. The tests use the current API.
Any defect of the API itself; the free name directory, normal for a fragment. The sample's 1000 happens to equal the default, so deleting the first argument alone gives the intended count by accident; for any other value the reader must find setMaxResults.
Exposure and likelihood123 words
- Who. Readers of the quality package overview who copy its sample. A 2009 java-user@ reply pointed a user to this page as the package's usage documentation. No query, document or index file reaches it.
- Default vs opt-in. The benchmark module is a separate, opt-in artifact. No configuration or special input is involved: the copied sample always fails.
- Scale. Every release from 2.3.0 (2008) to 10.6.0, and main (executed on 9 releases and main; the source of all 142 release tags read); no release ever shipped a compiling sample.
- Effect. A compile error, not wrong behaviour. javac names the 3-argument signature, and
setMaxResultsis in the class's method list. - Not claimed. Runtime defects of the same package are separate findings (LFV-935, LFV-936, LFV-937, LFV-940).
One JUnit class with one test. It compiles, with javax.tools against the jars on the test class path, a tiny class holding the sample's three lines that set up and make the execute call, verbatim; the benchmark, judge and logger come in as parameters. Nothing in Lucene runs, and the result does not depend on the test framework's random seed.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.benchmark.quality;
import java.nio.file.Files;
import java.nio.file.Path;
import javax.tools.ToolProvider;
import org.apache.lucene.tests.util.LuceneTestCase;
public class TestQualityPackageSample extends LuceneTestCase {
// Expected: the package overview's execute call compiles; actual: javac finds no execute(int, ...).
public void testOverviewExecuteCallCompiles() throws Exception {
Path dir = createTempDir();
Path src = dir.resolve("Sample.java");
Files.writeString(
src,
"""
import java.io.PrintWriter;
import org.apache.lucene.benchmark.quality.*;
import org.apache.lucene.benchmark.quality.utils.SubmissionReport;
class Sample {
QualityStats[] run(QualityBenchmark qrun, Judge judge, PrintWriter logger) throws Exception {
int maxResults = 1000;
SubmissionReport submitLog = null;
QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger);
return stats;
}
}
""");
int rc =
ToolProvider.getSystemJavaCompiler()
.run(
null, null, null, "-proc:none", "-cp", System.getProperty("java.class.path"), "-d",
dir.toString(), src.toString());
assertEquals(0, rc);
}
}
# $LUCENE: a built checkout (./gradlew jar); $REPRO: the directory holding org/apache/lucene/benchmark/quality/Test...java
# $DEPS: junit 4.13.2, randomizedtesting-runner 2.9.2, hamcrest 3.0
V=11.0.0-SNAPSHOT
CP=$LUCENE/lucene/core/build/libs/lucene-core-$V.jar:$LUCENE/lucene/codecs/build/libs/lucene-codecs-$V.jar:$LUCENE/lucene/benchmark/build/libs/lucene-benchmark-$V.jar:$LUCENE/lucene/test-framework/build/libs/lucene-test-framework-$V.jar:$DEPS
javac -d out -cp "$CP" $REPRO/org/apache/lucene/benchmark/quality/TestQualityPackageSample.java
java -ea -Dtests.seed=DEADBEEF -cp "out:$CP" org.junit.runner.JUnitCore org.apache.lucene.benchmark.quality.TestQualityPackageSample
# assertions off, same result: java -da -Dtests.asserts=false ...
- Expected
- The sample's
executecall compiles. - Observed
- One javac error,
required: Judge,SubmissionReport,PrintWriter; found: int,Judge,SubmissionReport,PrintWriter, with assertions on and off, on main and on the 10.6.0 jars.
More files, environment, full output299 words
The three lines are int maxResults = 1000;, SubmissionReport submitLog = null; and QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger); (package-info.java lines 44, 64 and 65 at 645d4fe14a20).
javac writes its diagnostic to stderr; the test asserts that the compiler returns 0, so the JUnit failure reads expected:<0> but was:<1>. Sample.java:8 is the execute line.
The whole block, extracted mechanically from the page, fails first with ';' expected at the line-41 statement; with that : read as ;, the same single execute error remains (the finder's whole-block test and an independent reproducer's test agree).
No separate regression test is suggested: the test copies the page's lines, so it would not notice a later edit of the javadoc, and the javadoc build does not compile this block (compile-checking javadoc examples is the open wish LUCENE-8488, #9534). If a reviewer wants one, it is this same test with the fixed lines, which passes. TestQualityRun already covers the real API.
| lucene | main 645d4fe14a20 (11.0.0-SNAPSHOT); the 10.6.0 release jars give the same error |
|---|---|
| jdk | OpenJDK 25.0.3 (build 25.0.3+9-LTS) |
| os | Linux aarch64 (the recorded checks ran on this platform only; the error comes from compile-time overload resolution) |
# the command above, main 645d4fe14a20, seed DEADBEEF, -ea (-da identical); lines in order, temp-dir prefix shortened, ... = test-framework notes / remaining runner frames
.../tempDir-001/Sample.java:8: error: method execute in class QualityBenchmark cannot be applied to given types;
QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger);
^
required: Judge,SubmissionReport,PrintWriter
found: int,Judge,SubmissionReport,PrintWriter
reason: actual and formal argument lists differ in length
1 error
...
There was 1 failure:
1) testOverviewExecuteCallCompiles(org.apache.lucene.benchmark.quality.TestQualityPackageSample)
java.lang.AssertionError: expected:<0> but was:<1>
at __randomizedtesting.SeedInfo.seed([DEADBEEF:B8371FF647951C59]:0)
...
at org.apache.lucene.benchmark.quality.TestQualityPackageSample.testOverviewExecuteCallCompiles(TestQualityPackageSample.java:50)
...
FAILURES!!!
Tests run: 1, Failures: 1
# the same test on the 10.6.0 release jars, -da: tests_run=1 failures=1, the same single diagnostic- The page presents the block as "a sample code used to run" the TREC benchmark; it is the overview's only example, and nothing marks it as pseudo-code.
- The 2008 change that removed the 4-argument
execute(LUCENE-1116) updatedQueryDriverandTestQualityRunbut missed this page. - Lucene's own code calls
setMaxResults(maxResults)and then the 3-argumentexecute.
The full argument217 words
- Offered as working code. "Here is a sample code used to run the TREC 2006 queries 701-850 on the .Gov2 collection" (line 36), the package overview's only code block, with no pseudo-code marker.
- History.
98fa2d898d1(LUCENE-836, #1911, 2007-07-27) added the package and the sample together, and the sample matched the then-existingexecute(int maxResults, Judge, SubmissionReport, PrintWriter); it compiles at that commit.9e65cd554f2(LUCENE-1116, #2193, 2008-01-03), whose issue description (not the commit message) lists "move control over max-docs-to-retrieve from benchmark constructor to a setter method (API change)" (in the parent's code the count was the first argument ofexecute, not a constructor argument), introducedsetMaxResults(int)and the 3-argumentexecute, and updatedQueryDriverandTestQualityRun, not the page. The sample compiles at the parent40eb1cd53fdand fails at9e65cd554f2. - A later fix pass missed it too.
647b5091697(2012-09-12, "code snippet improvements: fix out of date api usage ...", on trunk; its branch_4x twind8d5bf5e07dis the one in 4.0.0) rewrote the sample's reader lines for 4.0, kept theexecutecall and introduced the:. - No record accepts the old form. The recorded searches (as of 2026-11-01) found no issue, PR, list thread or Q&A post that uses or defends the 4-argument call; Stack Overflow answers about the package use the 3-argument
execute.
The devil's-advocate check129 words
Strongest case for "not a bug": the block is illustrative; it uses an undeclared directory and has the : typo, so nobody can expect it to compile as is. The API change was deliberate, the error is loud and names the right signature, and the module is a developer tool whose real entry point is QueryDriver.
Why it fails: the undeclared directory is context a reader supplies, but no context makes a removed signature compile. A deliberate API change that leaves the package's only sample stale is a documentation defect, not intended behaviour; the same change updated the two other call sites. The packages are exported and published, and the page has no disclaimer. Every verifier and the adjudication called it real; it stays a Low documentation defect.
Recommended Fix the two lines of the sample (validated)
Edit the sample (javadoc only): end the DirectoryReader.open(directory) line with ;, and replace the call with qrun.setMaxResults(maxResults); followed by qrun.execute(judge, submitLog, logger), as QueryDriver does. Validated by the recorded checks: the whole patched block compiles on main and 10.6.0, TestQualityRun passes, and the javadoc renders.
- * IndexReader ir = DirectoryReader.open(directory):
+ * IndexReader ir = DirectoryReader.open(directory);
@@
- * QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger);
+ * qrun.setMaxResults(maxResults);
+ * QualityStats stats[] = qrun.execute(judge, submitLog, logger);All options and trade-offs4 options ยท 351 words
One fix was validated, with the diff applied to 645d4fe14a20; the alternatives were not run.
Javadoc only, lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java lines 41 and 65; mirrors QueryDriver.java:96-98.
- * IndexReader ir = DirectoryReader.open(directory):
+ * IndexReader ir = DirectoryReader.open(directory);
@@
- * QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger);
+ * qrun.setMaxResults(maxResults);
+ * QualityStats stats[] = qrun.execute(judge, submitLog, logger);Trade-offs
None for users: documentation only, and no CHANGES entry is strictly needed. The block keeps its shape. It stays a fragment (it assumes directory and the imports, and closes neither the reader nor the files it opens), so a committer may reasonably prefer the QueryDriver pointer, a compiled {@snippet}, or deleting the sample. Backport: on 10.6.0 the block opens with <pre class="prettyprint"> (main's <pre><code class="language-java"> came with #15573), so the same two edits need new diff context.
What the checks validated
- The whole block extracted from the patched file (which differs from
645d4fe14a20only on lines 41 and 65), compiled by a one-test check: passes 1 of 1 on main with assertions on and off and on the 10.6.0 jars. The stock block fails the same check (';' expected), so the check detects the bug. - The minimal test with the fixed lines passes on main.
./gradlew :lucene:benchmark:test --tests "org.apache.lucene.benchmark.quality.*" -Ptests.seed=DEADBEEF:TestQualityRun, 2 tests, 0 failures../gradlew :lucene:benchmark:checkGoogleJavaFormatand:lucene:benchmark:renderJavadocpass, and the rendered package page showsqrun.setMaxResults(maxResults);and the 3-argumentexecute.
Shorter, and cannot go stale again.
Trade-offs
The overview loses its only inline example of the API; QueryDriver is a main() with argument parsing, a less direct read.
Makes the sample compile without touching it.
Trade-offs
Reverses a deliberate 2008 API change (LUCENE-1116) and adds API surface only to match stale docs.
The generic wish of LUCENE-8488 (#9534, open), for example via the javadoc {@snippet} tag backed by compiled code.
Trade-offs
Would stop this class of drift, but it is a build-infrastructure change, not part of this fix.
Downstream: Lucene.NET's port of this page carries the same stale execute call and : typo, and nobody has reported it there either.
No formal method. A probe compiled the code examples in package overviews against the main jars and hit this error; the hunt then reduced it to a one-test repro and checked every called signature in 22 release benchmark jars. Independent verifiers reproduced it with their own tests.
The method in full135 words
- First signal. A probe compiled the page's sample (only the
:read as;) with javac against the stock main645d4fe14a20and 10.5.2 jars and got one error, theexecutecall (2026-10-29). - Hunt. A hunt unit for javadoc examples in the analysis, benchmark and backward-codecs modules reduced it to one in-process javac JUnit test and ran a class-file presence scan of every signature the sample calls over 22 release benchmark jars (2.3.0 to 10.5.2) and main.
- Verification. An independent reproducer, a reviewer from another model family (OpenAI GPT-5.6) with a refute and an intended-behaviour lens, a devil's-advocate check, an adjudication and an audit (details under Independent checks).
- History. The introducing commit was found by building the quality package from the sources of each commit around the API change and compiling the sample against it.
No matching public report found: GitHub issues and PRs (with the migrated JIRA archive), commits, the dev@, java-user@, issues@ and commits@ lists, Stack Overflow, downstream repositories and the web were searched on 2026-10-29; re-checked 2026-11-01. qrun.execute and setMaxResults match no apache/lucene issue or PR, and no open PR touches the page.
Searches4 searches
Related, not reports: #2193 (LUCENE-1116) is the 2008 API change itself and never mentions the page; #1911 (LUCENE-836) added the then-correct sample; #10690 (LUCENE-9651) refreshed benchmark docs without touching this file; #9534 (LUCENE-8488) is a generic wish to compile javadoc examples; lucenenet#457 lists Lucene.NET's port of the page for a rewrite without identifying the defect.
Others file javadoc fixes often.
"New" means no matching public report was found in these recorded searches: GitHub keyword search does not cover PR diffs or review comments.
| Where | When | How | Found |
|---|---|---|---|
| Scripted searches | 2026-10-29 | 63 queries (GitHub issues, PRs and commits; downstream repositories; dev@, java-user@, issues@, commits@; the JIRA archive; the web; 53 before the web results were added) plus the finder's own earlier run (51 queries) | only history items (#2193, #1911) and generic context |
| GitHub, manual | 2026-10-29 | QualityBenchmark, QualityStats, qrun, Gov2, "quality package", SubmissionReport, setMaxResults; GitHub-wide and in apache/lucenenet; changed files of all 412 open PRs | no report; the Lucene.NET port carries the same stale call |
| Mailing lists, JIRA, Stack Overflow, web | 2026-10-29 | qrun.execute, execute(maxResults, QualityBenchmark, the exact call string; 10 emails, 3 questions and 4 answers read | nothing; all user code uses the 3-argument execute |
| GitHub re-check | 2026-11-01 | qrun.execute, "setMaxResults", QualityBenchmark, "benchmark/quality" in apache/lucene issues and PRs; changed files of the 31 open PRs updated since 2026-10-29; the file on main, branch_11x, branch_10_6 | no report; three PRs touch only benchmark-jmh; lines 41 and 65 unchanged upstream. Two searches (QualityStats, is:pr is:open javadoc example) were run again the same day: QualityStats finds only #3923 and #2193, and the javadoc-fix PRs (#16949, #16936, #16904) touch no lucene/benchmark file |
Stale since before the package's first release: LUCENE-1116 (9e65cd554f2, 2008-01-03) replaced execute(int maxResults, ...) with setMaxResults plus a 3-argument execute and missed the page; 2.3.0 already shipped that. A 2012 edit added the : typo. 2.2.0 has no quality package.
Versions tested5 rows
- Added, then correct:
98fa2d898d1(LUCENE-836, #1911, 2007-07-27) added the package and the sample; the 4-argumentexecuteexisted then. - Broken:
9e65cd554f2(LUCENE-1116, #2193, author date 2008-01-03): the sample compiles at the parent40eb1cd53fdand fails at this commit (quality package built from each commit's sources, against the 2.3.0 core jar: an isolation check, not a full historical build). - Touched, not fixed:
647b5091697(2012-09-12, on trunk; its branch_4x twind8d5bf5e07dshipped it in 4.0.0) rewrote the reader lines, kept the call and introduced the:;ac5e4dd3373(LUCENE-6224, 5.1.0) convertedpackage.htmltopackage-info.java;378ca8d1bbf(#15573, 2026-01-15) changed only the code-block tag. - branch_10x was decommissioned upstream on 2026-10-29 (#16911), which removed the file there; that is not a fix.
| Version or commit | Verdict | Result |
|---|---|---|
main 645d4fe14a20; upstream main f815e679bf6c | affected | fails with the single error, -ea and -da (upstream main read, not run: lines 41 and 65 unchanged) |
| 10.6.0 | affected | fails with the single error (release jars, -da) |
| 10.0.0, 10.5.2, 9.12.3 | affected | fails with the single error |
| 2.3.0, 3.6.2, 4.0.0, 8.11.4, 9.0.0 | affected | fails at the execute call (3.6.2's older text has two more errors) |
| 2.2.0 | no such package | not affected: the quality package does not exist there |
A finder, an independent reproducer, a reviewer from another model family (OpenAI GPT-5.6) with lenses, a devil's-advocate check, an adjudication and an audit. All found it real; the adjudication confirmed it with high confidence as a Low documentation defect.
Checks and verdicts226 words
The refute review executed code (on main ea57360912ed, whose lucene/benchmark is identical to 645d4fe14a20). The intended-lens reviewer could not run code; a separate re-run of the repro and the fix check gave it the results to read.
| Check | Verdict | What it found |
|---|---|---|
| Finder | reproduced (doc) | Compile check plus a class-file scan of 22 release benchmark jars: fails on main (-ea, -da), 10.5.2 and 9.12.3; the fix check passes. |
| Refute lens (OpenAI GPT-5.6) | real, high | Own JUnit and a corrected control on main ea57360912ed (-ea, -da, several seeds; same lucene/benchmark as 645d4fe14a20); ran TestQualityRun; checked 2.3.0. |
| Reproducer | real (doc, Low) | Own test: fails on main (-ea, -da), 10.5.2 and 9.12.3 with the same single error. |
| Intended lens (OpenAI GPT-5.6) | real, high | Intended argument weak. The reviewer read only; a separate run re-ran the repro (fail) and the fix check (pass) on main. |
| Devil's advocate | real (Low) | Re-ran on main (-ea, -da) and 10.5.2; javap on the 2.3.0 jar shows only the 3-argument execute. |
| Adjudication and audit | confirmed (high), Low | Re-ran on main; the one-test repro fails and its fixed twin passes. |
| Brief | verified; fix validated | Minimal test fails on main (-ea, -da) and on 10.6.0; the whole patched block compiles; the module's quality tests, format check and javadoc pass. |
The diagram as a still image, generated with AI and checked against the code. It is under 10 MB, the limit for a GitHub attachment.
- PNG 394 KB
Finding record, Lucene and upstream sources, repro files and diagram notes1,344 words
- Registry title
- The benchmark quality package overview's TREC sample calls
qrun.execute(maxResults, judge, submitLog, logger), a 4-argument QualityBenchmark.execute that no release has ever had (maxResults moved to setMaxResults(int) in LUCENE-1116, before 2.3.0, the package's first release), so the sample has not compiled in any release (documentation defect) - Area
- benchmark / search-quality package (quality/package-info.java: the package overview's TREC sample)
- Priority
- Low, rank 1256: A TREC sample in the opt-in benchmark quality overview has failed loudly at compile time since 2.3.0, with no runtime effect.
- Impact class
- minor
- Impact note
- Documentation only, with no runtime effect: anyone who starts a search-quality evaluation from the opt-in benchmark module's quality package overview and copies its TREC sample gets a compile error on main and on every release since 2.3.0 (2008); javac names the correct 3-argument signature, the in-tree QueryDriver shows the right calls, and nothing wrong ever runs.
- Summary
- You start a search-quality evaluation from the benchmark quality package overview, which presents its code block as 'a sample code used to run the TREC 2006 queries 701-850 on the .Gov2 collection', and expect it to compile against the package's API. It does not, on main or on any release since 2.3.0: the sample calls
qrun.execute(maxResults, judge, submitLog, logger), but QualityBenchmark has only execute(Judge, SubmissionReport, PrintWriter) and takes the result count from setMaxResults(int), so javac rejects the call (the DirectoryReader.open line also ends with ':' instead of ';'). The API change was deliberate (LUCENE-1116, 2008) and the in-tree QueryDriver does it right (setMaxResults, then the 3-argument execute); only the page was never updated. - Introduced
- 9e65cd554f2e (LUCENE-1116 = #2193 'contrib.benchmark.quality package improvements', Doron Cohen, svn era, no PR, author date 2008-01-03) replaced execute(int maxResults, Judge, SubmissionReport, PrintWriter) with execute(Judge, SubmissionReport, PrintWriter) plus setMaxResults(int) ('move control over max-docs-to-retrieve from benchmark constructor to a setter method (API change)'), and updated QueryDriver and TestQualityRun but not the package.html sample [exec: the sample compiles at 98fa2d898d1, a614f0d99a6 and 40eb1cd53fd (the parent) and fails at 9e65cd554f2, with the quality package built from each commit's sources against the 2.3.0 core jar]. The sample was added, then correct, by 98fa2d898d1 (LUCENE-836 = #1911, 2007-07-27). 647b5091697 (2012-09-12, 'code snippet improvements: fix out of date api usage', first in 4.0.0) rewrote the sample's reader lines, left the execute call and added the ':' typo on main line 41 [read: git log -S and git show in the full-history clone]. (2008-01-03 (9e65cd554f2, author date); the ':' typo 2012-09-12 (647b5091697))
- First affected version
- 2.3.0 [exec], the first release with the quality package; it already contains 9e65cd554f2, so no release ever shipped a compiling version of the sample (it compiled only on trunk, 2007-07-27 to 2008-01-03)
- Affected versions
- every release from 2.3.0 to 10.6.0 (10.6.0 = branch_10_6 4ae946e5a9b [exec 2026-11-01: the minimal test fails on the 10.6.0 release jars, lucene-benchmark-10.6.0.jar included, with the execute error]), main 645d4fe14a20 and upstream main a518d9ae1777 (2026-10-29); not fixed upstream. [exec: the page's own text of each era compiled against that release's jars fails with the execute error on 2.3.0, 3.6.2 (plus two errors of the 2.3-era text), 4.0.0, 8.11.4, 9.0.0, 9.12.3 (-ea and -da), 10.0.0, 10.5.2 (-ea and -da) and main (-ea and -da); 2.2.0 has no quality package] [read: all 141 release tags in the history clone that have the package carry the exact line and only the 3-argument execute; a class-file scan of 22 release benchmark jars, 2.3.0 to 10.5.2, finds no execute(int, ...) overload; the 10.6.0 RC1 page and QualityBenchmark.execute equal main's (the RC jar set has no benchmark jar); upstream main read]. branch_10x was decommissioned upstream on 2026-10-29 (#16911), which removed the file there; that is not a fix. Not new in 10.6. Caveat: all runs used JDK 25 on Linux aarch64; the 2007-2008 commit-level runs compile against the 2.3.0 core release jar.
- Status
- documented (brief, checks and a per-finding doc exist)
- Verification
- Confirmed by AI-run checks: an independent repro, a cross-model review that agreed, an intended-behaviour check, a prior-report search and a skeptical audit; not yet triaged by a person.
- Found by
- non-formal
- Upstream and prior reports
- none found (searched 2026-10-29): a scripted search with 63 queries (GitHub issues and PRs 22, commits 3, downstream 2, dev@/java-user@/issues@/commits@ 20, JIRA archive 6, web 10; 335 distinct hits, 0 high) plus the finder's 51-query run; manual GitHub searches (QualityBenchmark, QualityStats, qrun, Gov2, 'quality package', SubmissionReport, benchmark quality javadoc, items created since 2026-10-27, the parallel javadoc-fix authors); the changed-file lists of all 412 open apache/lucene PRs (newest #16943); hand-run JIRA queries; lists.apache.org searches with 10 emails read; Stack Overflow (3 questions and 4 answers read, all using the correct 3-argument execute) and the web. The independent reproduction's, the intended-behaviour check's and the adjudication's searches found nothing either. Recheck (2026-10-29): six GitHub searches (incl. everything created since a recent cutoff) find nothing new; none of the 25 open PRs updated since 2026-10-28 touches benchmark/quality; the page's latest commit on main is still 378ca8d1bbf (#15573, author date 2026-01-15, wrapper tag only) and upstream main a518d9ae1777 still has lines 41 and 65 as on 645d4fe. Closest items, not reports: #2193 (LUCENE-1116, the 2008 API change itself; it never mentions the page), #1911 (LUCENE-836, which added the package and the then-correct sample), #10690 (LUCENE-9651, a benchmark doc refresh via #759 that did not touch this file), #9534 (LUCENE-8488, a generic proposal to compile javadoc examples) and lucenenet#457 (Lucene.NET's port carries the same stale sample and lists the file for a .NET rewrite without identifying the defect). Not fixed upstream.
- Lucene commit tested
- main
645d4fe14a20(2026-10-28): the minimal test fails with assertions on and off (standalone, with a plainjavac/javacommand); the 10.6.0 release jars give the same single error; eight releases from 2.3.0 to 10.5.2 (2.3.0, 3.6.2, 4.0.0, 8.11.4, 9.0.0, 9.12.3, 10.0.0, 10.5.2) were run in the version-history runs (and the introducing commit against its parent), and the source of all 142 release tags with the package was read; the fix was checked (recorded checks) with the diff applied to645d4fe14a20(the whole patched block compiles on main and on 10.6.0;TestQualityRunpasses, 2 tests;./gradlew :lucene:benchmark:checkGoogleJavaFormatand:lucene:benchmark:renderJavadocpass, and the rendered package page shows the corrected lines). Upstream mainf815e679bf6c(2026-11-01) was read, not run: lines 41 and 65 are unchanged.
- Finding record
lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java:36 ('Here is a sample code used to run ...'), :38-70 (the block), :41 ('DirectoryReader.open(directory):'), :65 ('qrun.execute(maxResults, adjudication, submitLog, logger)')lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/QualityBenchmark.java:96 (execute(Judge, SubmissionReport, PrintWriter)), :167 (setMaxResults(int)); quality/trec/QueryDriver.java:96-98 and lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/TestQualityRun.java:82-86 (setMaxResults, then the 3-argument execute); lucene/benchmark/src/java/module-info.java:39-41 (the quality packages are exported)
- The finding in 30 seconds
a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java:36, :38 (<pre><code>), :41 (':'), :44, :63-65, :70a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/QualityBenchmark.java:63-64 (maxResults, Default: 1000), :96 (execute(Judge, SubmissionReport, PrintWriter)), :106, :167 (setMaxResults)a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java:96-98; lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/TestQualityRun.java:82-86a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/module-info.java:39-41 (quality, quality.trec, quality.utils exported)
- Minimal repro
a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java:44, :64, :65 (the three lines in the test, verbatim)
- Why it looks unintended
a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java:36-70a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java:96-98; lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/TestQualityRun.java:85-86
- Suggested fix
a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java:96-98a Lucene clone: releases/lucene/10.6.0 package-info.java:38 (<pre class="prettyprint">); 378ca8d1bbf (#15573) is not in 10.6.0 (git merge-base --is-ancestor)
- History
a Lucene clone: releases/lucene/10.6.0 package-info.java:41, :65 and QualityBenchmark.java:96, :167 (read)
- Independent checks
a Lucene clone: git diff ea57360912ed 645d4fe14a20 -- lucene/benchmark (empty)
- TestQualityPackageSample.java (one test, public API):
repro/LFV-1040/TestQualityPackageSample.java(52 lines)
Six steps and a summary card (about 83 s), drawn from compiles executed on main 645d4fe14a20: the verbatim block (';' expected at line 41), the block with only the : fixed (the single execute error) and the patched block (compiles); every drawn fact is asserted against snapshots of the code and the run records. The PNG is the summary frame.
assets/LFV-1040/bug.png(394 KB)
