10000 recognize Java 21 version (65) · scala/scala-asm@dd57050 · GitHub
[go: up one dir, main page]

Skip to content

Commit dd57050

Browse files
committed
recognize Java 21 version (65)
1 parent 2ff73af commit dd57050

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

asm-util/src/main/java/org/objectweb/asm/util/ASMifier.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public class ASMifier extends Printer {
110110
classVersions.put(Opcodes.V18, "V18");
111111
classVersions.put(Opcodes.V19, "V19");
112112
classVersions.put(Opcodes.V20, "V20");
113+
classVersions.put(Opcodes.V20, "V21");
113114
CLASS_VERSIONS = Collections.unmodifiableMap(classVersions);
114115
}
115116

asm/src/main/java/org/objectweb/asm/ClassReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public ClassReader(
194194
this.b = classFileBuffer;
195195
// Check the class' major_version. This field is after the magic and minor_version fields, which
196196
// use 4 and 2 bytes respectively.
197-
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V20) {
197+
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V21) {
198198
throw new IllegalArgumentException(
199199
"Unsupported class file major version " + readShort(classFileOffset + 6));
200200
}

asm/src/main/java/org/objectweb/asm/Opcodes.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ public interface Opcodes {
286286
int V18 = 0 << 16 | 62;
287287
int V19 = 0 << 16 | 63;
288288
int V20 = 0 << 16 | 64;
289+
int V21 = 0 << 16 | 65;
289290

290291
/**
291292
* Version flag indicating that the class is using 'preview' features.

asm/src/test/java/org/objectweb/asm/ConstantsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ private static ConstantType getType(final Field field) {
253253
case "V18":
254254
case "V19":
255255
case "V20":
256+
case "V21":
256257
return ConstantType.CLASS_VERSION;
257258
case "ACC_PUBLIC":
258259
case "ACC_PRIVATE":

0 commit comments

Comments
 (0)
0