Skip to content

Commit 3a29daa

Browse files
committed
ASM-generated class names get interned for better memory allocation
Issue: SPR-14886
1 parent dc8cd4e commit 3a29daa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,8 @@ public String readClass(final int index, final char[] buf) {
24642464
// computes the start index of the CONSTANT_Class item in b
24652465
// and reads the CONSTANT_Utf8 item designated by
24662466
// the first two bytes of this CONSTANT_Class item
2467-
return readUTF8(items[readUnsignedShort(index)], buf);
2467+
String name = readUTF8(items[readUnsignedShort(index)], buf);
2468+
return (name != null ? name.intern() : null);
24682469
}
24692470

24702471
/**

0 commit comments

Comments
 (0)