Bug 29884 - Partial parameters matching is not working or not flagged as error
Summary: Partial parameters matching is not working or not flagged as error
Status: REOPENED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-21 10:07 EST by Maxim Mossienko CLA
Modified: 2009-08-30 02:50 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Mossienko CLA 2003-01-21 10:07:55 EST
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");
  }
}
Comment 1 Jim Hugunin CLA 2003-01-21 11:47:21 EST
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.
Comment 2 Eclipse Webmaster CLA 2009-08-30 02:50:42 EDT
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.