Community
Participate
Working Groups
Build Identifier: AspectJ Compiler 1.6.8 (1.6.8 - Built: Friday Jan 8, 2010 at 21:53:37 GMT) - Eclipse Compiler 0.785_R33x, 3.3 If you have a declare soft with a call pointcut, and the call pointcut is selecting methods with an annotation it will fail to match (fail to soften the exception) if: a) the annotated method being called is in another class b) *you compile using -sourceroots*! Compiling with "ajc -1.5 -sourceroots ." causes the bug to manifest. Compiling with "ajc -1.5 *.aj *.java" works normally. I will attach a simple test case. Reproducible: Always Steps to Reproduce: 1. declare soft : Exception : call (@Ann * *(..)); 2. call a method annotated with @Ann in class C, from class C2 3. compile using: ajc -1.5 -sourceroots .
Created attachment 162940 [details] Test case to reproduce bug. Make sure you compile this test case as "ajc -1.5 -sourceroots ." to reproduce. If you compile it as "ajc -1.5 *.aj *.java" it works fine! Also note that if the pointcut is changed to match by name, it works with both compilation methods.
i suspect it will be a compilation ordering issue (as you kind of confirm by saying *.aj *.java works normally). The type containing the annotation being processed before or after the type containing the joinpoint will be the issue. i'll try and get to it for 1.6.9 - thanks for the testcase.
I can confirm it is an ordering problem. rdyer@narmada:~/bug$ ajc -1.5 Test.java Test2.java Ann.java Bug.aj rdyer@narmada:~/bug$ ajc -1.5 Test2.java Test.java Ann.java Bug.aj /home/rdyer/bug/Test.java:4 [error] Unhandled exception type Exception new Test2().m2(); ^^^^^^^^^^^^^ 1 error
test and fix committed. thanks for the testcase!