Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

被代理方法参数含有primitive类型时,会抛出 java.lang.NoSuchMethodException #103

Open
light0x00 opened this issue Dec 29, 2021 · 0 comments

Comments

@light0x00
Copy link

light0x00 commented Dec 29, 2021

image

如果被代理方法的参数有 primitive 类型,比如 int,args[k].getClass() 取出来是 java.lang.Integer ,之后执行 Method method = Class.forName(classType).getMethod(methodName, classes); 就会抛出 java.lang.NoSuchMethodException

这里正确的取被代理方法参数类型的方式应该是:

((MethodInvocationProceedingJoinPoint.MethodSignatureImpl) ((MethodInvocationProceedingJoinPoint) joinPoint).signature).getParameterTypes()
@light0x00 light0x00 changed the title BUG: RequestApiLogRecordAop 类型 BUG: 被代理方法含有primitive类型时,会抛出 java.lang.NoSuchMethodException Dec 29, 2021
@light0x00 light0x00 changed the title BUG: 被代理方法含有primitive类型时,会抛出 java.lang.NoSuchMethodException 被代理方法含有primitive类型时,会抛出 java.lang.NoSuchMethodException Dec 29, 2021
@light0x00 light0x00 changed the title 被代理方法含有primitive类型时,会抛出 java.lang.NoSuchMethodException 被代理方法参数含有primitive类型时,会抛出 java.lang.NoSuchMethodException Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant