Deprecate/move CGLIB methods AopUtils=>ClassUtils
isCglibProxy* methods in AopUtils are useful in lower-level modules, i.e. those that cannot depend on .aop. Therefore copied these methods to ClassUtils; deprecated the existing ones in AopUtils and now delegating to the new location; switched all usage of AopUtils#isCglibProxy* within the framework to use ClassUtils#isCglibProxy* instead.
This commit is contained in:
@@ -1083,4 +1083,30 @@ public abstract class ClassUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the given object is a CGLIB proxy.
|
||||
* @param object the object to check
|
||||
* @see org.springframework.aop.support.AopUtils#isCglibProxy(Object)
|
||||
*/
|
||||
public static boolean isCglibProxy(Object object) {
|
||||
return ClassUtils.isCglibProxyClass(object.getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the specified class is a CGLIB-generated class.
|
||||
* @param clazz the class to check
|
||||
*/
|
||||
public static boolean isCglibProxyClass(Class<?> clazz) {
|
||||
return (clazz != null && isCglibProxyClassName(clazz.getName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the specified class name is a CGLIB-generated class.
|
||||
* @param className the class name to check
|
||||
*/
|
||||
public static boolean isCglibProxyClassName(String className) {
|
||||
return (className != null && className.contains(CGLIB_CLASS_SEPARATOR));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user