Community
Participate
Working Groups
The pointcut in the example below is not applied. public class Test1<E> { public void method1(E...args) { } } public aspect TestAspect { after(Test1 test1, Object[] arg) returning: execution(* Test1.method1(Object...)) && target(test1) && args(arg) { System.out.println("got here"); } } The error occurs only if vararg is a type parameter. Removing vararg argument arg from the pointcut declaration (as below) fixes pointcut matching. Changing varag to be a generic type with type parameter E (for example, List<E>) also fixes the problem. public aspect TestAspect { after(Test1 test1) returning: execution(* Test1.method1(Object...)) && target(test1) { System.out.println("got here"); } }
this is now fixed in the tree... I just need to kick the build machine back into life so that it will publish a new build to the download page incorporating the fix.
fix now available in latest build on AspectJ download page.
The fix is incorporated in the *AspectJ* compiler download, but AspectJ compiler development builds are not automatically rolled into AJDT - instead AJDT takes drops of the compiler at set intervals. When AJDT next upgrades their compiler level (which we should try and do again soon) then this fix will be available from AJDT too.