Browse Source

运行到intercept中的target已被cglib代理,无条件获取父类

James 2 years ago
parent
commit
df1a79c9bd
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/main/java/com/jfinal/ext/proxy/CglibCallback.java

+ 5 - 5
src/main/java/com/jfinal/ext/proxy/CglibCallback.java

@@ -39,11 +39,11 @@ class CglibCallback implements MethodInterceptor {
 			return methodProxy.invokeSuper(target, args);
 		}
 		
-		Class<?> targetClass = target.getClass();
-		if (targetClass.getName().indexOf("$$EnhancerBy") != -1) {
-			targetClass = targetClass.getSuperclass();
-		}
-		
+		// Class<?> targetClass = target.getClass();
+		// if (targetClass.getName().indexOf("$$EnhancerBy") != -1) {
+		// 	targetClass = targetClass.getSuperclass();
+		// }
+		Class<?> targetClass = target.getClass().getSuperclass();
 		
 		MethodKey key = InterceptorCache.getMethodKey(targetClass, method);
 		Interceptor[] inters = InterceptorCache.get(key);