mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-07-25 22:34:45 +02:00
31 lines
681 B
Java
31 lines
681 B
Java
// 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
|
|
}
|
|
} |