diff --git a/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/proxy/AsgcProxyGenerator.java b/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/proxy/AsgcProxyGenerator.java index fc21f9d4..bb70f07b 100644 --- a/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/proxy/AsgcProxyGenerator.java +++ b/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/proxy/AsgcProxyGenerator.java @@ -79,7 +79,10 @@ public class AsgcProxyGenerator { Method[] methods = targetType.getMethods(); if (ArrayUtil.notEmpty(methods)) { for (Method method : methods) { - if (Modifier.isFinal(method.getModifiers()) || Modifier.isStatic(method.getModifiers())) { + if (Modifier.isFinal(method.getModifiers()) || + Modifier.isStatic(method.getModifiers()) || + method.isSynthetic() + ) { continue; } Long methodId = ProxyCache.setMethod(method); diff --git a/neutrino-core/src/test/java/fun/asgc/neutrino/core/aop/AsgcProxyGeneratorTest.java b/neutrino-core/src/test/java/fun/asgc/neutrino/core/aop/AsgcProxyGeneratorTest.java index 2f7465cf..7102c1c7 100644 --- a/neutrino-core/src/test/java/fun/asgc/neutrino/core/aop/AsgcProxyGeneratorTest.java +++ b/neutrino-core/src/test/java/fun/asgc/neutrino/core/aop/AsgcProxyGeneratorTest.java @@ -22,8 +22,13 @@ package fun.asgc.neutrino.core.aop; import fun.asgc.neutrino.core.aop.proxy.AsgcProxyGenerator; +import fun.asgc.neutrino.core.base.Handler; import org.junit.Test; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + /** * * @author: aoshiguchen @@ -43,4 +48,23 @@ public class AsgcProxyGeneratorTest { System.out.println(result); } + @Test + public void test3() throws InvocationTargetException, IllegalAccessException { + Method[] methods = A.class.getDeclaredMethods(); + methods[0].invoke(new A(), "aa", "bb"); + System.out.println(methods[0].isSynthetic()); + } + + public static class A implements Handler{ + public void handle(String s, String s2) { + System.out.println("hello"); + } + + public void a() { + + } + + + } + }