ソースを参照

无拦截器时不通过 Invocation 调用目标方法

James 2 年 前
コミット
940a2366bb
1 ファイル変更4 行追加2 行削除
  1. 4 2
      src/main/java/com/jfinal/ext/proxy/CglibCallback.java

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

@@ -52,13 +52,15 @@ class CglibCallback implements MethodInterceptor {
 			InterceptorCache.put(key, inters);
 		}
 		
+		if (inters.length == 0) {
+		    return methodProxy.invokeSuper(target, args);
+		}
+		
 		Invocation invocation = new Invocation(target, method, inters,
 			x -> {
 				return methodProxy.invokeSuper(target, x);
 			}
 		, args);
-		
-		
 		invocation.invoke();
 		return invocation.getReturnValue();
 	}