From 3a08d643ed79d33843258f85338b838662f0fa79 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 31 Jan 2023 16:06:33 +0100 Subject: [PATCH] Upgrade to ASM master (including early support for Java 21 bytecode) Closes gh-29910 --- .../src/main/java/org/springframework/asm/ClassReader.java | 2 +- spring-core/src/main/java/org/springframework/asm/Opcodes.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/asm/ClassReader.java b/spring-core/src/main/java/org/springframework/asm/ClassReader.java index 5286462d058..d84485cafdf 100644 --- a/spring-core/src/main/java/org/springframework/asm/ClassReader.java +++ b/spring-core/src/main/java/org/springframework/asm/ClassReader.java @@ -194,7 +194,7 @@ public class ClassReader { this.b = classFileBuffer; // Check the class' major_version. This field is after the magic and minor_version fields, which // use 4 and 2 bytes respectively. - if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V20) { + if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V21) { throw new IllegalArgumentException( "Unsupported class file major version " + readShort(classFileOffset + 6)); } diff --git a/spring-core/src/main/java/org/springframework/asm/Opcodes.java b/spring-core/src/main/java/org/springframework/asm/Opcodes.java index 35efefb9d95..035aa454847 100644 --- a/spring-core/src/main/java/org/springframework/asm/Opcodes.java +++ b/spring-core/src/main/java/org/springframework/asm/Opcodes.java @@ -285,6 +285,7 @@ public interface Opcodes { int V18 = 0 << 16 | 62; int V19 = 0 << 16 | 63; int V20 = 0 << 16 | 64; + int V21 = 0 << 16 | 65; /** * Version flag indicating that the class is using 'preview' features.