Bug 319783

Summary: Compilation error for unmatched declare @method/@field
Product: [Tools] AspectJ Reporter: Anwar Rizal <anrizal05>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 1.6.9   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Anwar Rizal CLA 2010-07-13 15:45:48 EDT
Build Identifier: 20100617-1415

Given a class X as follow:

public class X {

	private Y y1;
	
	private Y y2;


	public Y getY1() {
		return y1;
	}

	public void setY1(Y y) {
		this.y1 = y;
	}

	public Y getY2() {
		return y2;
	}

	public void setY2(Y y) {
		this.y2 = y;
	}
	
}

And Y :

public class Y {
}

The following aspect has an unexpected compilation error:
[error] The field 'private Y X.a*' does not exist 

// Compilation Error
public aspect OneToOneAspect {

	declare @field : private Y X.a* : @MyAnnotation;
}

When the OneToOneAspect is modified as follow (the pattern matches), the compilation works fine.

// No compilation error
public aspect OneToOneAspect {

	declare @field : private Y X.y* : @MyAnnotation;
}




Reproducible: Always

Steps to Reproduce:
See above.
Comment 1 Anwar Rizal CLA 2010-07-13 15:47:36 EDT
Nothing special for the annotation:

public @interface MyAnnotation {

}