From b719a87061f75a1fcf485b15f07b729b3f642869 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 7 Feb 2023 17:19:12 +0100 Subject: [PATCH] Suggest AOP proxy or CGLIB_CLASS_SEPARATOR check instead of isCglibProxyClass See gh-22706 --- .../main/java/org/springframework/util/ClassUtils.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/ClassUtils.java b/spring-core/src/main/java/org/springframework/util/ClassUtils.java index a8d6552b21..ae4ab61837 100644 --- a/spring-core/src/main/java/org/springframework/util/ClassUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ClassUtils.java @@ -870,9 +870,9 @@ public abstract class ClassUtils { /** * Check whether the given object is a CGLIB proxy. * @param object the object to check - * @see #isCglibProxyClass(Class) * @see org.springframework.aop.support.AopUtils#isCglibProxy(Object) * @deprecated as of 5.2, in favor of custom (possibly narrower) checks + * such as for a Spring AOP proxy */ @Deprecated public static boolean isCglibProxy(Object object) { @@ -882,8 +882,9 @@ public abstract class ClassUtils { /** * Check whether the specified class is a CGLIB-generated class. * @param clazz the class to check - * @see #isCglibProxyClassName(String) + * @see #getUserClass(Class) * @deprecated as of 5.2, in favor of custom (possibly narrower) checks + * or simply a check for containing {@link #CGLIB_CLASS_SEPARATOR} */ @Deprecated public static boolean isCglibProxyClass(@Nullable Class clazz) { @@ -893,7 +894,9 @@ public abstract class ClassUtils { /** * Check whether the specified class name is a CGLIB-generated class. * @param className the class name to check + * @see #CGLIB_CLASS_SEPARATOR * @deprecated as of 5.2, in favor of custom (possibly narrower) checks + * or simply a check for containing {@link #CGLIB_CLASS_SEPARATOR} */ @Deprecated public static boolean isCglibProxyClassName(@Nullable String className) { @@ -917,6 +920,7 @@ public abstract class ClassUtils { * class, but the original class in case of a CGLIB-generated subclass. * @param clazz the class to check * @return the user-defined class + * @see #CGLIB_CLASS_SEPARATOR */ public static Class getUserClass(Class clazz) { if (clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) {