Skip to content

Commit d859826

Browse files
committed
ASM-generated class names get interned for better memory allocation
Issue: SPR-14862
1 parent d759c96 commit d859826

File tree

1 file changed

+2
-2
lines changed
  • spring-core/src/main/java/org/springframework/asm

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ public String getClassName() {
562562
}
563563
return sb.toString();
564564
case OBJECT:
565-
return new String(buf, off, len).replace('/', '.');
565+
return new String(buf, off, len).replace('/', '.').intern();
566566
default:
567567
return null;
568568
}
@@ -577,7 +577,7 @@ public String getClassName() {
577577
* @return the internal name of the class corresponding to this object type.
578578
*/
579579
public String getInternalName() {
580-
return new String(buf, off, len);
580+
return new String(buf, off, len).intern();
581581
}
582582

583583
/**

0 commit comments

Comments
 (0)