Skip to content

Test on Java 21 and 25 through additional_test_java_versions - #1194

Merged
timtebeek merged 2 commits into
mainfrom
tim/pr-120-adopt
Oct 16, 2026
Merged

timtebeek merged 2 commits into
mainfrom
tim/pr-120-adopt

Conversation

@timtebeek

@timtebeek timtebeek commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Adopts openrewrite/gh-automation#120: CI now runs the tests on Java 21 in the build job and on Java 25 in a separate test (Java 25) job, where before it only ran them on 25. The build.gradle.kts override that set the toolchain to 25 is gone, so the build falls back to the recipe-library plugin's toolchain, which is 21. rewrite-java-21 and rewrite-java-25 are both on the test runtime classpath now, so JavaParser.fromJavaVersion() gets the parser that matches each JVM. ci.yml swaps java_version: 25/21 for additional_test_java_versions: '[25]', which is the same setup as rewrite-migrate-java.

The two MockitoWhenOnStaticToMockStaticTest tests that use unnamed variables now run only on Java 25, because the Java 21 parser cannot read them.

Drop the toolchain override to 25, so the build and its tests run on the
recipe-library plugin's Java 21 toolchain again, and put both rewrite-java-21
and rewrite-java-25 on the test runtime classpath. The new
additional_test_java_versions input of ci-gradle.yml then runs the tests on
Java 25 as well (openrewrite/gh-automation#120).
The Java 21 parser cannot parse unnamed variables, which became final in
Java 22.
@timtebeek
timtebeek merged commit f032e18 into main Oct 16, 2026
2 checks passed
@timtebeek
timtebeek deleted the tim/pr-120-adopt branch October 16, 2026 14:47
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant