Community
Participate
Working Groups
When a percflow aspect is woven into source code from a jar using the aspectPath compiler option, it produces only one instance of the aspect for each entrypoint defined in the source code.
This bug needs a self-contained example in order to be verified and fixed. Here are two examples of bug reports for similar bugs that contained good examples: https://bugs.eclipse.org/bugs/show_bug.cgi?id=39462 https://bugs.eclipse.org/bugs/show_bug.cgi?id=41123 It would be very valuable to us if you could provide a similar example for this bug. Thanks for your help.
Created attachment 5863 [details] test project with build.xml Here's a test case that demonstrates the bug. The default ant target tests the aspect code first compiled along with the test and then tests a second time with the aspect in a jar and the testcase compiled with the jar in the aspect path. To use the build.xml in this project, you'll need to create a lib folder in the project containing aspectjrt.jar, aspecttools.jar, and junit.jar. Also, in order for the ant tasks to work, it will be a good idea to drop junit jar in ANT_HOME/lib The results of both tests can be found in html form under ./dist/junit_output
Created attachment 5898 [details] decompiled normally compiled code Shows attached (normally compiled) test code after being decompiled
Created attachment 5899 [details] decompiled jar compiled code Shows attached (compiled from jar) test code after being decompiled
This is a great test case and easy to reproduce. I've raised this to a P2 bug. The general problem is that any code that extends an abstract aspect from a .jar file does not inherit the per-clause from the super-aspect, so all such aspects behave like persingletons. This is true for percflow, pertarget and perthis. The simple work-around is to explicitly include the per-clause in the concrete aspects declaration, i.e.: aspect MyTestPerCFlowEntryPoint extends PerCFlowCompileFromJar percflow(topOfFlow()) { The bug is now fixed in the tree and should be in the 1.1.1 release.