summaryrefslogtreecommitdiffstats
path: root/tests/bugs/declareSoftWithin/test/NoSoftener.java
blob: 5d082c19908db961fc14ab2b7b4d8de6d7d98a5b (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
package test;
import java.lang.reflect.Constructor;
import org.aspectj.testing.Tester;

/**
 * @author Ron Bodkin
 * @author Jim Hugunin
 */
public class NoSoftener {
    public static void main(String[] args) {
        Throwable wrapped = null;
        try {
            new NoSoftener().foo(Integer.class);
        } catch (org.aspectj.lang.SoftException se) {
            wrapped = se.getWrappedThrowable();
        }
        Tester.checkNonNull(wrapped, "exception thrown");
        Tester.check(wrapped instanceof NoSuchMethodException,
                "must be NoSuchMethodException");
        
    }
    
    public void foo(Class clazz) {
        Class[] keyArgType = {};
        Constructor ctor = clazz.getConstructor(keyArgType);
    }
}