aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/DeclareSoftCf.java
blob: 2c9e5581e42f406d198208be249e1e9d708c940c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// from Bug 28921 
import org.aspectj.lang.*;

public class DeclareSoftCf {

    public static void a(){
        b();
    }
    /**
     * Method b.
     */
    private static void b() {
        throw new RuntimeException("Orig");
    }
    
    public static void main(String[] args) {
        try {
            a();
        } catch (SoftException e) {
            System.out.println(e.getWrappedThrowable());
        }
    }
    
    public static interface Checked{
    }
    
    static aspect Softner{
        declare parents : Exception+ && !RuntimeException implements Checked;
        declare soft : Checked : within(DeclareSoftCf);  // ERR: Checked not a Throwable
    }
}