Bug 64238 - Regression or change of language definition when compiling aspect
Summary: Regression or change of language definition when compiling aspect
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.0   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-26 18:01 EDT by Macneil Shonle CLA
Modified: 2006-05-30 04:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Macneil Shonle CLA 2004-05-26 18:01:25 EDT
The below code is a simplification of an event listener style poincut
interface: (See below for a description of the bug itself.)

public class AnyoneListening {
	public static void main(String[] args) {
		AnyoneListening a = new AnyoneListening();
		Util u = new Util();
		a.doStuff(u);
	}
	
	public void doStuff(Util u) {
		notifyUtilUsed(u);
	}
	
	private void notifyUtilUsed(Util u) {/*intentionally left blank*/}
	public pointcut utilUsed(AnyoneListening al, Util u):
		this(al) && args(u) && execution(void AnyoneListening.doStuff
(Util));
	
	private void notifyUtilLookedAt(Util u) {/*intentionally left blank*/}
	public pointcut utilLookedAt(AnyoneListening al, Util u):
		execution(void AnyoneListening.notifyUtilLookedAt(Util))
		&& this(al) && args(u);
	
	public pointcut utilTouched(AnyoneListening al, Util u):
		utilUsed(al, u) || utilLookedAt(al, u);
}

class Util {
}

aspect Observer {
	before(AnyoneListening al, Util u): AnyoneListening.utilTouched(al, u) {
		System.out.println("Someone used it");
	}
}

//////////////////

This code compiles fine with ajc 1.1.1, but under 1.2 I get the following
error message:

Ambiguous binding of type Util using args(..) at this line.  Use one args(..) 
per matched join point, see secondary source location for location of 
extraneous args(..).

It worked in 1.1.1, and supposedly 1.2 didn't change the semantics of the
language, thus I file. :-)
Comment 1 Andrew Clement CLA 2004-05-27 03:32:20 EDT
I'll just point out the bug that caused the introduction of this new message,
bug 61568.
Comment 2 Andrew Clement CLA 2006-05-30 04:15:59 EDT
pointcut rewriting in AspectJ5 means the program compiles fine now.