Skip to content

Add Java 26 early-access support via rewrite-java-next module#6789

Closed
timtebeek wants to merge 3 commits intomainfrom
timtebeek/java-26-support
Closed

Add Java 26 early-access support via rewrite-java-next module#6789
timtebeek wants to merge 3 commits intomainfrom
timtebeek/java-26-support

Conversation

@timtebeek
Copy link
Copy Markdown
Member

Summary

Adds a new rewrite-java-next module to support Java 26 early-access builds. This enables early validation of the OpenRewrite parser against pre-release JDK versions. The module is structured as a copy of rewrite-java-25 with version references updated to 26.

Changes

  • New rewrite-java-next module with Java 26 toolchain and parser implementation
  • Updated JavaParser version detection cascade to prefer JavaNextParser for JDK 26+
  • Extended CI workflows to test against Java 26-ea
  • All version-specific classes renamed from Java25 to JavaNext (e.g., JavaNextParser, ReloadableJavaNextParser)

Adds a new rewrite-java-next module (copy of rewrite-java-25) to support Java 26 pre-release builds, enabling early validation of the OpenRewrite parser against upcoming JDK versions. Updates version detection cascade in JavaParser and CI workflows to include Java 26.
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/publish.yml Outdated
Adds --enable-preview to the ReloadableJavaNextParser compiler options so
the parser can handle preview language features like JEP 530 (Primitive
Types in Patterns, instanceof, and switch). Adds tests for primitive type
patterns in switch expressions and instanceof with guards, narrowing
conversions, and different primitive types (int, long, float).
@timtebeek
Copy link
Copy Markdown
Member Author

It looks like we should be good to support the non-preview features in Java 26 already, and even the JEP 530: Primitive Types in Patterns, instanceof, and switch does not require parser changes.

We'll defer this effort until later, such that we don't have to unnecessarily maintain yet another Java parser with any changes.

@timtebeek timtebeek closed this Feb 22, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Feb 22, 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