summaryrefslogtreecommitdiffstats
path: root/tests/new/verifyError/Privilege.java
blob: 89f154d16e426a706c88e811533294da16874a76 (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;

class C {
	private int i;
}

privileged aspect A {
	private int C.j = 1;
	private static String C.s = "hello";
	
	private String C.m() {
		return "from A";
	}
}

/** @testcase PR#36673 privileged aspect main verify error */
public privileged aspect Privilege {
	public static void main(String[] args) {
	    C c = new C();
		Tester.checkEqual(1, c.j, "wrong value for c.j");
		Tester.checkEqual("hello", C.s, "wrong value for C.s");
		Tester.checkEqual("from A", c.m(), "c.m()");
	}	
}