Bug 577112 - problem compiling or weaving target pointcuts
Summary: problem compiling or weaving target pointcuts
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: 1.9.7   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL: https://github.com/ccronemberger/aspe...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-07 05:54 EST by Constantino Cronemberger CLA
Modified: 2021-11-07 05:55 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Constantino Cronemberger CLA 2021-11-07 05:54:32 EST
I have created this project to reproduce the multiple problems I found:

https://github.com/ccronemberger/aspectj-bugs

By changing the configuration it is possible to reproduce problems in different scenarios. The changes are to be done in two files:

build.gradle - to select either weaving or compilation
the class MyTargetAspect2 by changing the @Around annotation
In the class MyTargetAspect2 I have added comments about the results I get with each of the 3 cases.

Case #3 is the only one that looks correct for me.

Case #2 works in terms of number of interceptions but is clearly not correct in the number of join points applied (the logs appear only in the weaving case).

Case #1 is the worst case for both compilation and weaving: with weaving the code does not even run and with compilation the number of interceptions is completelly wrong and the stack trace is also much bigger.

I know that in the Case #1 we would get more interceptions because it would count 2 executions and 2 calls, but still it would be only 4 interceptions and not 12.

In order to modify the build.gradle file to use compilation instead of weaving one can uncomment the line with "aspectj.AspectjGradlePlugin", uncommend the "aspectpath" declaration, and finally comment the lines with "jvmArgs".