File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
spring-aop/src/main/java/org/springframework/aop
spring-core/src/main/java/org/springframework/util Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -166,7 +166,7 @@ public Object getProxy(@Nullable ClassLoader classLoader) {
166
166
Assert .state (rootClass != null , "Target class must be available for creating a CGLIB proxy" );
167
167
168
168
Class <?> proxySuperClass = rootClass ;
169
- if (ClassUtils . isCglibProxyClass ( rootClass )) {
169
+ if (rootClass . getName (). contains ( ClassUtils . CGLIB_CLASS_SEPARATOR )) {
170
170
proxySuperClass = rootClass .getSuperclass ();
171
171
Class <?>[] additionalInterfaces = rootClass .getInterfaces ();
172
172
for (Class <?> additionalInterface : additionalInterfaces ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -66,8 +66,8 @@ public abstract class AopUtils {
66
66
* @see #isCglibProxy
67
67
*/
68
68
public static boolean isAopProxy (@ Nullable Object object ) {
69
- return (object instanceof SpringProxy &&
70
- ( Proxy . isProxyClass ( object .getClass ()) || ClassUtils . isCglibProxyClass ( object . getClass () )));
69
+ return (object instanceof SpringProxy && ( Proxy . isProxyClass ( object . getClass ()) ||
70
+ object .getClass (). getName (). contains ( ClassUtils . CGLIB_CLASS_SEPARATOR )));
71
71
}
72
72
73
73
/**
@@ -91,7 +91,8 @@ public static boolean isJdkDynamicProxy(@Nullable Object object) {
91
91
* @see ClassUtils#isCglibProxy(Object)
92
92
*/
93
93
public static boolean isCglibProxy (@ Nullable Object object ) {
94
- return (object instanceof SpringProxy && ClassUtils .isCglibProxy (object ));
94
+ return (object instanceof SpringProxy &&
95
+ object .getClass ().getName ().contains (ClassUtils .CGLIB_CLASS_SEPARATOR ));
95
96
}
96
97
97
98
/**
Original file line number Diff line number Diff line change @@ -841,7 +841,9 @@ public static boolean isInnerClass(Class<?> clazz) {
841
841
* @param object the object to check
842
842
* @see #isCglibProxyClass(Class)
843
843
* @see org.springframework.aop.support.AopUtils#isCglibProxy(Object)
844
+ * @deprecated as of 5.2, in favor of custom (possibly narrower) checks
844
845
*/
846
+ @ Deprecated
845
847
public static boolean isCglibProxy (Object object ) {
846
848
return isCglibProxyClass (object .getClass ());
847
849
}
@@ -850,15 +852,19 @@ public static boolean isCglibProxy(Object object) {
850
852
* Check whether the specified class is a CGLIB-generated class.
851
853
* @param clazz the class to check
852
854
* @see #isCglibProxyClassName(String)
855
+ * @deprecated as of 5.2, in favor of custom (possibly narrower) checks
853
856
*/
857
+ @ Deprecated
854
858
public static boolean isCglibProxyClass (@ Nullable Class <?> clazz ) {
855
859
return (clazz != null && isCglibProxyClassName (clazz .getName ()));
856
860
}
857
861
858
862
/**
859
863
* Check whether the specified class name is a CGLIB-generated class.
860
864
* @param className the class name to check
865
+ * @deprecated as of 5.2, in favor of custom (possibly narrower) checks
861
866
*/
867
+ @ Deprecated
862
868
public static boolean isCglibProxyClassName (@ Nullable String className ) {
863
869
return (className != null && className .contains (CGLIB_CLASS_SEPARATOR ));
864
870
}
You can’t perform that action at this time.
0 commit comments