Skip to content

Commit 83e2938

Browse files
cookie-meringuebclozel
authored andcommitted
Optimize ClassNameReader.getClassName via direct ASM API
getClassName now calls ClassReader.getClassName() directly instead of routing through the visitor-based getClassInfo. Previously, it allocated a List and a ClassVisitor and decoded super_class and every interface name only to discard all but the first element. The method is on the hot path of every CGLIB proxy class definition, so this change significantly lowers its per-call processing cost. Closes gh-36814 Signed-off-by: cookie-meringue <daehyeon3351@gmail.com>
1 parent ee5c82a commit 83e2938

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

spring-core/src/main/java/org/springframework/cglib/core/ClassNameReader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ private ClassNameReader() {
3434
private static class EarlyExitException extends RuntimeException {
3535
}
3636

37+
// SPRING PATCH BEGIN
3738
public static String getClassName(ClassReader r) {
38-
return getClassInfo(r)[0];
39+
return r.getClassName().replace('/', '.');
3940
}
41+
// SPRING PATCH END
4042

4143
public static String[] getClassInfo(ClassReader r) {
4244
final List<String> array = new ArrayList<>();

0 commit comments

Comments
 (0)