Skip to content

Derive test expectations from the JDK feature version - #518

Merged
slachiewicz merged 1 commit into
masterfrom
agent/jdk27-tests
Sep 20, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/jdk27-tests

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Sep 15, 2026

Copy link
Copy Markdown
Member

The javac and eclipse compiler tests decided their expected errors, warnings, output files and -source/-target by checking java.version for the substrings 11, 17, 21 and 25. Any other JDK fell through to the Java 1.3 defaults or to expecting ReservedWord.class, so the suite failed on JDK 26 and 27 with four failures across plexus-compiler-javac and plexus-compiler-eclipse. This adds getJavaFeatureVersion() to AbstractCompilerTest, 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 EclipseCompilerErrorsAsWarningsTest now expects three output files like its two sibling tests, since assert has been a keyword since Java 1.4.

Verified: full mvn verify with -Dversion.maven-invoker-plugin=3.10.2-SNAPSHOT → green on JDK 27 and on JDK 26, and plain mvn verify green on JDK 21, all including the 12 ITs. Not run on JDK 25 locally.

This change was created with AI assistance.

@slachiewicz slachiewicz added the maintenance Cleanup, refactoring or other internal change label Sep 15, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 15, 2026 23:46
Base automatically changed from agent/errorprone-2.50 to master September 19, 2026 00:12
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
slachiewicz merged commit 2febea4 into master Sep 20, 2026
36 checks passed
@slachiewicz
slachiewicz deleted the agent/jdk27-tests branch September 20, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Cleanup, refactoring or other internal change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant