Community
Participate
Working Groups
In 1.1.b4 Consider following code / aspect, aspect, which has 'around' join point for method that contains greater number of parameters than bound in pointcut, is not working. I found only following statement in 1.1 changes documentation about 1.1b4 formals support 'we did not implement the handling of multiple .. wildcards in args PCDs (rarely encountered in the wild)', it is not clear if this behavior is described. class A { void testA(int B, int C) { } public static void main(String[] argv) { new A().testA(0,1); } } aspect B { pointcut testA(int a): args(a) && execution(void A.testA(int,int)); void around(int a): testA(a) { System.out.println("Before testA"); proceed(a); System.out.println("After testA"); } }
Your pointcut doesn't match because args(a) doesn't match the execution of a method with two arguments. You could use either args(a, int) or args(int, a) depending on whether you want the first or second argument. If the semantics is confusing, please bring this up on the users mailing list. I'll leave this bug around as a feature request for some sort of warning message when a pcd can never match anything.
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.