mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
28 lines
466 B
Java
28 lines
466 B
Java
|
class Foo {
|
||
|
|
||
|
public static void main(String[] args) {
|
||
|
(new Foo()).m1();
|
||
|
System.out.println("---");
|
||
|
(new Bar()).m1();
|
||
|
}
|
||
|
|
||
|
public void m1() { }
|
||
|
}
|
||
|
|
||
|
class Bar extends Foo {
|
||
|
public void m1() { super.m1(); }
|
||
|
}
|
||
|
|
||
|
aspect A {
|
||
|
static before(): instanceof(Foo) && executions(public * *(..)) {
|
||
|
System.out.println("executions");
|
||
|
}
|
||
|
|
||
|
|
||
|
static before(): instanceof(Foo) && receptions(public * *(..)) {
|
||
|
System.out.println("receptions");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|