Derive test expectations from the JDK feature version - #518
Open
slachiewicz wants to merge 1 commit into
Open
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
The javac and eclipse compiler tests listed the JDKs they knew (11, 17, 21, 25) by substring, so any other JDK fell back to Java 1.3 source settings or to expecting ReservedWord.class, and the suite failed on JDK 26 and 27. A shared getJavaFeatureVersion() replaces the lists.
slachiewicz
force-pushed
the
agent/errorprone-2.50
branch
from
September 15, 2026 23:38
83c7cd9 to
7fc81d5
Compare
slachiewicz
force-pushed
the
agent/jdk27-tests
branch
from
September 15, 2026 23:38
c3a1351 to
bf7eea9
Compare
slachiewicz
marked this pull request as ready for review
September 15, 2026 23:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The javac and eclipse compiler tests decided their expected errors, warnings, output files and
-source/-targetby checkingjava.versionfor the substrings11,17,21and25. Any other JDK fell through to the Java 1.3 defaults or to expectingReservedWord.class, so the suite failed on JDK 26 and 27 with four failures acrossplexus-compiler-javacandplexus-compiler-eclipse. This addsgetJavaFeatureVersion()toAbstractCompilerTest, which works on Java 8, and rewrites those checks as numeric comparisons. The errorprone test uses the same helper.Behaviour on JDK 11, 17, 21 and 25 is unchanged. On JDK 9 and 10 the
EclipseCompilerErrorsAsWarningsTestnow expects three output files like its two sibling tests, sinceasserthas been a keyword since Java 1.4.Stacked on #517.
Verified: full
mvn verifywith-Dversion.maven-invoker-plugin=3.10.2-SNAPSHOT→ green on JDK 27 and on JDK 26, including all 12 ITs. Not run on JDK 21 or 25 locally.This change was created with AI assistance.