Stop assuming that AspectJ Advice has JoinPoint as the first argument - #34316
JoshuaChen wants to merge 3 commits into
Conversation
Signed-off-by: Joshua Chen <27291761@qq.com>
|
Hi @JoshuaChen, Congratulations on submitting your first PR for the Spring Framework!. 👍
How did you come to the conclusion? Please provide an example that worked with a previous version of AspectJ and began to fail with a recent version of AspectJ (for example 1.9.22.1 which we currently support). In addition, you will need to introduce a JUnit-Jupiter based test in the test suite that covers this scenario. Thanks |
|
hi~
AspectJ should return JoinPoint in the first parameter. However, when I ran and debugged it in my own demo app, I saw that it returned JoinPoint in the last element of getParameterTypes(). Additionally, please give me some time to provide unit tests, and I will try to complete them. |
Signed-off-by: Joshua Chen <27291761@qq.com>
|
hi~ @sbrannen You are correct, this exception is not related to the AspectJ version. I found that version 6.1.6 does not trigger the exception, but version 6.1.7 does. The change to isAspect() in version 6.1.7 (#32793) opened Pandora’s box. The “Advice argument binding failure” issue has always existed; it just wasn’t triggered before. In version 6.1.6 and earlier (apologies, I couldn’t test all versions), there was no handling for the corresponding AspectJ method, so it “worked normally.” Additionally, unit tests have been added. Please help me review the code. |
Signed-off-by: Joshua Chen <27291761@qq.com>
See gh-34316 Signed-off-by: Joshua Chen <27291761@qq.com>
|
Thanks very much for making your first contribution to Spring Framework, @JoshuaChen. |
After enabling
@EnableTransactionManagement(mode = AdviceMode.ASPECTJ, proxyTargetClass = true), an exception occurs.The issue seems to be that AspectJ has changed its logic, and the first element in
aspectJAdviceMethod.getParameterTypes()no longer returnsJoinPoint, causing the exception.