mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-16 14:10:51 +02:00
34 lines
459 B
Java
34 lines
459 B
Java
|
|
|
|
public class Basic3 {
|
|
public static void main(String []argv) {
|
|
Basic3 b = new Basic3();
|
|
if (!(b instanceof X.I)) throw new RuntimeException("Basic3 should implement I");
|
|
((X.I)b).m2();
|
|
((X.I)b).m3();
|
|
((X.I)b).m2();
|
|
((X.I)b).m4();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
aspect X {
|
|
|
|
interface I {
|
|
}
|
|
|
|
public void I.m2() { }
|
|
public void I.m3() { }
|
|
public void I.m4() { }
|
|
|
|
|
|
declare parents: Basic3 implements I;
|
|
|
|
|
|
before(): call(* m*(..)) {
|
|
}
|
|
|
|
}
|
|
|