add MethodUtil

This commit is contained in:
Looly
2022-05-05 00:24:08 +08:00
parent 140e1d546f
commit 6d7d350886
30 changed files with 1168 additions and 1234 deletions

View File

@@ -1,8 +1,8 @@
package cn.hutool.extra.aop.interceptor;
import cn.hutool.extra.aop.aspects.Aspect;
import cn.hutool.core.reflect.ClassUtil;
import cn.hutool.core.reflect.ModifierUtil;
import cn.hutool.core.reflect.ReflectUtil;
import cn.hutool.extra.aop.aspects.Aspect;
import java.io.Serializable;
import java.lang.reflect.InvocationHandler;
@@ -47,7 +47,7 @@ public class JdkInterceptor implements InvocationHandler, Serializable {
ReflectUtil.setAccessible(method);
try {
result = method.invoke(ClassUtil.isStatic(method) ? null : target, args);
result = method.invoke(ModifierUtil.isStatic(method) ? null : target, args);
} catch (final InvocationTargetException e) {
// 异常回调(只捕获业务代码导致的异常,而非反射导致的异常)
if (aspect.afterException(target, method, args, e.getTargetException())) {