mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
20 lines
496 B
Java
20 lines
496 B
Java
|
import org.aspectj.testing.*;
|
||
|
|
||
|
public class DeclareWarningMain {
|
||
|
public static void main (String[] args) { // DW 5 main
|
||
|
Tester.checkAllEvents();
|
||
|
}
|
||
|
static {
|
||
|
Tester.expectEvent("before");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
aspect Warnings {
|
||
|
declare warning : execution(static void main(String[])) : "main"; // for DW 5 main
|
||
|
|
||
|
// just to show that pointcut is valid - works if warning removed
|
||
|
before() : execution(static void main(String[])) {
|
||
|
Tester.event("before");
|
||
|
}
|
||
|
}
|