Bug 319783 - Compilation error for unmatched declare @method/@field
Summary: Compilation error for unmatched declare @method/@field
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.9   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-13 15:45 EDT by Anwar Rizal CLA
Modified: 2010-07-13 15:47 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 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 {

}