summaryrefslogtreecommitdiffstats
path: root/tests/new/DeclareWarningMain.java
blob: 243a4668b055d0677d38decb3ec8f2e51be334df (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 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");
    }
}