Skip to content

Commit 247d2e3

Browse files
committed
Merge branch '6.2.x'
2 parents 49237fc + b5008d3 commit 247d2e3

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

spring-core/src/main/java/org/springframework/asm/ClassReader.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,16 @@ public ClassReader(
193193
final byte[] classFileBuffer, final int classFileOffset, final boolean checkClassVersion) {
194194
this.classFileBuffer = classFileBuffer;
195195
this.b = classFileBuffer;
196+
196197
// Check the class' major_version. This field is after the magic and minor_version fields, which
197198
// use 4 and 2 bytes respectively.
198-
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V25) {
199-
throw new IllegalArgumentException(
200-
"Unsupported class file major version " + readShort(classFileOffset + 6));
201-
}
199+
// SPRING PATCH: leniently try to parse newer class files as well
200+
// if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V26) {
201+
// throw new IllegalArgumentException(
202+
// "Unsupported class file major version " + readShort(classFileOffset + 6));
203+
// }
204+
// END OF PATCH
205+
202206
// Create the constant pool arrays. The constant_pool_count field is after the magic,
203207
// minor_version and major_version fields, which use 4, 2 and 2 bytes respectively.
204208
int constantPoolCount = readUnsignedShort(classFileOffset + 8);

spring-core/src/main/java/org/springframework/asm/Opcodes.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ public interface Opcodes {
290290
int V23 = 0 << 16 | 67;
291291
int V24 = 0 << 16 | 68;
292292
int V25 = 0 << 16 | 69;
293+
int V26 = 0 << 16 | 70;
293294

294295
/**
295296
* Version flag indicating that the class is using 'preview' features.

spring-core/src/main/java/org/springframework/asm/SymbolTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ private static final class LabelEntry {
14731473

14741474
/**
14751475
* Another entry (and so on recursively) having the same hash code (modulo the size of {@link
1476-
* SymbolTable#labelEntries}}) as this one.
1476+
* SymbolTable#labelEntries}) as this one.
14771477
*/
14781478
LabelEntry next;
14791479

0 commit comments

Comments
 (0)