Support class file version 70 (Java 26) - #4
Merged
Conversation
Java 26 reached GA on 2026-03-17 with class file major version 70. Per the JVMS SE 26 spec (section 4), the class file format is structurally identical to version 61 (Java 17): no new constant pool tags, predefined attributes, or access flags were added. The spec states major_version must be in the range 45 through 70 inclusive for a Java SE 26 JVM. Add the Java26 constant (70.0) and advance Latest to it. The decoder guards already compare against ClassFormatVersion.Latest.Major, so this raises the accepted version cap to 70 automatically. Preview/Valhalla structures (e.g. the LoadableDescriptors attribute, ACC_STRICT reused as a field flag) live in the separate preview spec supplement and only appear in version 70.65535 class files; they remain out of scope. Such class files still decode, with unknown attributes preserved as UnknownAttribute. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes #1.
Summary
Java 26 reached GA on 2026-03-17 with class file major version 70. This adds support for it — building on the
Latest-driven guard introduced in #2. Together with #2 (through Java 25) this brings the library current with every released JVM, resolving #1.Spec check (JVMS SE 26 §4)
Answering the question raised in #1 ("any major changes between 63 and 70, or just a constant bump?"): I pulled the Java SE 26 class file spec and verified the format is structurally identical to version 61 (Java 17) — no new structures were added between 63 and 70:
Dynamic, v55)PermittedSubclasses, v61 / Java 17)major_versionaccepted rangeThe spec is explicit: "The
major_versionitem must be a value in the range 45 through 70, inclusive. A Java Virtual Machine implementation which conforms to Java SE 26 supports precisely these major version numbers."(Note:
RecordandPermittedSubclasses, mentioned in the issue thread, were already implemented — they landed in v60/v61, at or below the old cap of 63. So for 63→70 specifically, this is indeed just the version constant.)Change
ClassFormatVersion.Java26 = new(70, 0).ClassFormatVersion.LatesttoJava26.The decoder guards (
TryMeasure/TryRead) already compare againstClassFormatVersion.Latest.Major(from #2), so the accepted-version cap rises to 70 automatically — noClassFile.cschange needed. Builds clean (0 errors).Out of scope: preview / Valhalla
The value-class work does introduce real format changes (a
LoadableDescriptorsattribute;ACC_STRICTreused as a field flag), but these live in the separate preview spec supplement and only appear in70.65535(preview-enabled) class files — not mainline version 70. Those class files still decode today (unknown attributes are preserved asUnknownAttribute); they would only fail on re-encode. Implementing preview/Valhalla structures can be a follow-up if/when desired.🤖 Generated with Claude Code