Skip to content

Support class file versions through Java 25 (major 69) - #2

Merged
wasabii merged 1 commit into
mainfrom
support-class-version-69
Jul 18, 2026
Merged

Support class file versions through Java 25 (major 69)#2
wasabii merged 1 commit into
mainfrom
support-class-version-69

Conversation

@wasabii

@wasabii wasabii commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@

Summary

The decoder guarded on majorVersion > 63, rejecting Java 20–25 class files even though all of their structures already decode correctly. This raises the cap to Java 25 (major 69).

Background

I audited the full class-file surface against the JVMS through Java 25:

Surface Status
Constant pool tags Complete (all 17, incl. Dynamic, InvokeDynamic, Module, Package)
Attributes Complete (incl. NestHost/NestMembers, Record, PermittedSubclasses); full decode↔encode round-trip
Opcodes Complete (through jsr_w, 201)
StackMapTable frames Complete
Version constants Complete (through Java 25)

The class file format has been stable since Java 17 (major 61, PermittedSubclasses). Java 20–25 bumped the version number for compatibility gating and preview-feature binding, not for new permanent structures. So no new structures needed implementing — only the stale guard was blocking these versions.

Changes

  • Add ClassFormatVersion.Latest (= Java25).
  • Replace both majorVersion > 63 guards (in TryMeasure and TryRead) with a comparison against ClassFormatVersion.Latest.Major, so the cap tracks the newest defined version automatically instead of drifting behind a magic number.

Notes

  • Builds clean (0 errors).
  • Out of scope here: a separate latent bug in StackMapFrame.CopyTo routes frame types 64–65 to SameStackMapFrame (valid only 0–63). Not version-related; can be a follow-up.

🤖 Generated with Claude Code
@

The decoder guarded on `majorVersion > 63`, rejecting Java 20-25 class
files even though all of their structures (attributes, constant pool
tags, opcodes, stack map frames) already decode correctly. The format
has been stable since Java 17 (major 61); no new structures were added
in 20-25.

Add a `ClassFormatVersion.Latest` constant (= Java25) and compare the
decoder guards against it so the cap tracks the newest defined version
automatically instead of drifting behind a magic number.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wasabii
wasabii merged commit 77f6bc1 into main Jul 18, 2026
21 checks passed
@wasabii
wasabii deleted the support-class-version-69 branch July 18, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant