From 02979b8017cbaadc8747f1fd84966bb1b1e03543 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Sat, 18 Jul 2026 09:18:15 -0500 Subject: [PATCH] Support class file version 70 (Java 26) 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 --- src/IKVM.ByteCode/ClassFormatVersion.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/IKVM.ByteCode/ClassFormatVersion.cs b/src/IKVM.ByteCode/ClassFormatVersion.cs index c814a14..e2195bf 100644 --- a/src/IKVM.ByteCode/ClassFormatVersion.cs +++ b/src/IKVM.ByteCode/ClassFormatVersion.cs @@ -86,8 +86,11 @@ public record struct ClassFormatVersion(ushort Major, ushort Minor) : IComparabl /// Java 25 (class file 69.0) public static readonly ClassFormatVersion Java25 = new(69, 0); + /// Java 26 (class file 70.0) + public static readonly ClassFormatVersion Java26 = new(70, 0); + /// The latest class file format version supported by this library. - public static readonly ClassFormatVersion Latest = Java25; + public static readonly ClassFormatVersion Latest = Java26; /// /// Implicitly converts a major version number to a with a minor version of 0.