summaryrefslogtreecommitdiffstats
path: root/tests/bugs/declareBinding/SampleExceptionHandling1.java
blob: 4b5e4ae4819d47d3abbc87d81a6c423c7b361ffe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class SampleExceptionHandling1 {
    public void mumble() throws java.io.IOException { } // CE expected
}


/** @author Ron Bodkin */
aspect Library {
    public pointcut executionsThrowingChecked() : 
        execution(* *(..) throws (Exception+ && !RuntimeException));
}

/** @author Ron Bodkin */
aspect SampleExceptionHandling {
    public pointcut scope() : within(SampleExceptionHandling1);
    
    public pointcut executionsThrowingChecked() : 
        Library.executionsThrowingChecked() && scope();

    declare error : executionsThrowingChecked(): 
        "no checked exceptions";
}