blob: ab8768ac981f39c23b53c75b119b9f9f47bd1c78 (
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
27
28
29
30
31
32
33
34
35
36
|
import org.aspectj.lang.annotation.*;
public class Basic3b {
public static void main(String []argv) {
Basic3b b = new Basic3b();
if (!(b instanceof X.I)) throw new RuntimeException("Basic3b should implement I");
((X.I)b).m2();
((X.I)b).m3();
((X.I)b).m2();
((X.I)b).m4();
}
}
@Aspect class X {
interface I {
}
class IIimpl implements I {
public void m2() { }
public void m3() { }
public void m4() { }
}
@DeclareParents("Basic3b",defaultimpl="IImpl")
private I simplefield;;
@Before("call(* *(..))")
public void advice1() {}
}
|