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

before方法中返回类型转换问题 #462

Open
jin840919 opened this issue May 11, 2024 · 1 comment
Open

before方法中返回类型转换问题 #462

jin840919 opened this issue May 11, 2024 · 1 comment
Assignees
Labels

Comments

@jin840919
Copy link

现在想在AdviceListener的before方法中而不是after方法直接阻断目标方法执行,返回结果,但是获取不到返回值类型,会有类型转换问题,有解决办法吗

@oldmanpushcart oldmanpushcart self-assigned this May 13, 2024
@oldmanpushcart
Copy link
Collaborator

因为他们是不同的ClassLoader加载的类,你在module中写的是ModuleJarClassLoader所加载,然后目标应用是有自己的ClassLoader,两个互相隔离。你可以通过getClass().getSimpleName()获取到类名称去做你想要的判断。

另外我不是太理解,这个和before/after有什么关系?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants