blob: 22efc6de7ce60b6ab6b1512106d9454310d5b4b3 (
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
|
import org.aspectj.testing.Tester;
import org.aspectj.testing.Tester;
/** @testcase PR#573 pertarget stack overflow getting name of anonymous class */
public class PR573 {
static public void main(String[] params) {
Tester.expectEvent("A.init0");
final Object o = new Interface() {
public void m(Object oa) {
oa.toString();
}};
Tester.check(null != o, "null != o");
((Interface) o).m("hi"); // no exceptions
Tester.check(1 == A.num, "1 == A.num: " + A.num);
Tester.checkAllEvents();
}
}
interface Interface { void m(Object o);}
aspect A pertarget(target(Interface)) { // CW 21 will not match containing aspect
public static int num;
A(){ Tester.event("A.init" + num++); }
}
|