|
|
@@ -0,0 +1,33 @@ |
|
|
|
public class InheritedThrows { |
|
|
|
|
|
|
|
static aspect A { |
|
|
|
declare warning : execution (* *.*(..) throws Ex1) : "one"; |
|
|
|
// declare warning : execution (* *.*(..) throws Ex2) : "two"; |
|
|
|
// declare warning : execution (* *.*(..) throws !(Ex1||Ex2)) : "neither"; |
|
|
|
// declare warning : execution (* *.*(..) throws Ex1, Ex2) : "both"; |
|
|
|
} |
|
|
|
|
|
|
|
public static class Ex1 extends Exception {} |
|
|
|
|
|
|
|
public static class Ex2 extends Exception {} |
|
|
|
|
|
|
|
public interface MyInterface { |
|
|
|
public void m() throws Ex1, Ex2; |
|
|
|
} |
|
|
|
|
|
|
|
private static class NestedClass1 implements MyInterface { |
|
|
|
public void m() throws Ex1 {} |
|
|
|
} |
|
|
|
|
|
|
|
private static class NestedClass2 implements MyInterface { |
|
|
|
public void m() throws Ex2 {} |
|
|
|
} |
|
|
|
|
|
|
|
private static class NestedClassBoth implements MyInterface { |
|
|
|
public void m() throws Ex1, Ex2 {} |
|
|
|
} |
|
|
|
|
|
|
|
private static class NestedClassNeither implements MyInterface { |
|
|
|
public void m() {} |
|
|
|
} |
|
|
|
} |