summaryrefslogtreecommitdiffstats
path: root/tests/java5/decps/Basic3b.java
blob: 1d4ecfe5aafdf3c1301c208cfcc054da58b6ee54 (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
37
38
39
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 { 
	  public void m2();
	  public void m3();
	  public void m4();
  }

  static class IImpl implements I {
    public void m2() { }
    public void m3() { }
    public void m4() { }
  }


  @DeclareParents(value="Basic3b",defaultImpl=IImpl.class)
  private I simplefield;


  @Before("call(* *(..))")
  public void advice1() {}

}