aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/ClassLiteralField.java
blob: 13539479fd506bd0a3fbceb984a5535ccb69a9f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import org.aspectj.testing.Tester;

public class ClassLiteralField {  // synthetic class$n set
	public static void main(String[] args) {
		Class c = ClassLiteralField.class;  // synthetic class$n get
		assert c != null;  //synthetic $assert
		new ClassLiteralField().doInner();
	}
	int x=10;
	void doInner() {
		new Runnable() {         // synthetic this$n
			public void run() {
				x+=1;            // synthetic this$n
			}
		}.run();
	}
}

aspect A {
//	before(): within(ClassLiteralField) && get(* *) && !get(* x) {
//		System.out.println("get: " + thisJoinPoint +", " + thisJoinPoint.getSourceLocation());
//	}

	declare error: within(ClassLiteralField) && get(* *) && !get(* x): "unexpected get";
	declare error: within(ClassLiteralField) && set(* *) && !set(* x): "unexpected set";
}