Bug 552687 - Two @Around advices on the same method lead to errors
Summary: Two @Around advices on the same method lead to errors
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.9.4   Edit
Hardware: PC Windows 10
: P3 normal with 1 vote (vote)
Target Milestone: 1.9.5   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-05 04:55 EST by Alexander Kriegisch CLA
Modified: 2019-12-02 20:45 EST (History)
1 user (show)

See Also:


Attachments
Sample project reproducing the problem (5.93 KB, application/x-zip-compressed)
2019-11-05 04:55 EST, Alexander Kriegisch CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kriegisch CLA 2019-11-05 04:55:17 EST
Created attachment 280509 [details]
Sample project reproducing the problem

Sorry to be so unspecific with the topic description, but I do not know what is happening here and what exactly causes the error. The problem was reported here first: https://stackoverflow.com/questions/58626598

I am attaching a sample project reproducing the problem. It starts occurring in AspectJ 1.9.3 and persists in 1.9.4. Downgrading to 1.9.2 solves the problem, so something that was changed in the compiler after 1.9.2 must cause the issue.

First I thought it was related to JUnit 5 (Jupiter), but it is not, it also occurs when running the woven code with a sample main(..) method. So you have a choice running 'mvn clean test' or just compiling manually from CLI or IDE with AspectJ 1.9.4 and then running AspectSimple.main(..) and check the end of the log output (NullPointerException instead of the expected CustomException). 

It looks as if something was off with thrown exception propagation to another around advice, but this is just speculation.
Comment 1 Andrew Clement CLA 2019-11-25 15:40:21 EST
I think this was due to a tweak I put in to 1.9.3: https://bugs.eclipse.org/bugs/show_bug.cgi?id=333274

In there I wrote: 
I did have to tweak the code gen to inject that finally block, probably the bit of code I'm most nervous about but all existing tests are passing. I'll keep an eye on feedback once the release is out.


Then in 1.9.4 someone raised https://bugs.eclipse.org/bugs/show_bug.cgi?id=547808

which I have fixed already. And indeed trying 1.9.5.BUILD-SNAPSHOT with this test project works for me (phew).

So I think it is already fixed. I've finished the upgrade to Java13, I just want to address one more thing before putting out 1.9.5.
Comment 2 Alexander Kriegisch CLA 2019-12-02 20:45:01 EST
My retest with 1.9.5 was successful, thanks Andy. :-)