blob: 82c7ae38e425b1e569d757010c685b73572f1454 (
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;
public class AspectOfInterface {
public static void main(String[] args) { test(); }
public static boolean ranAdvice = false;
public static void test() {
new C().foo();
Tester.check(ranAdvice, "advice on interface");
}
}
interface I {
public void foo();
}
class C implements I {
public void foo() { } //System.out.println("foo"); }
}
aspect A /*of eachobject(instanceof(I))*/ {
before(): call(* *(..)) {
AspectOfInterface.ranAdvice = true; //System.out.println("before");
}
}
|