aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/DeclareWarningMain.java
blob: add8ff01e36dc303e10cb9816e8678a54fbc0812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import org.aspectj.testing.*;

public class DeclareWarningMain {
    public static void main (String[] args) {  // DW 4 main
        Tester.checkAllEvents();
    } 
    static {
        Tester.expectEvent("before");
    }
}

aspect Warnings {
    declare warning : execution(static void main(String[])) : "main"; // for DW 4 main

    // just to show that pointcut is valid - works if warning removed
    before() : execution(static void main(String[])) {
        Tester.event("before");
    }
}