You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InheritedThrows.java 781B

123456789101112131415161718192021222324252627282930
  1. public class InheritedThrows {
  2. static aspect A {
  3. after() throwing(Ex1 a): execution(* *.*(..) throws Ex1) {}
  4. }
  5. public static class Ex1 extends Exception {}
  6. public static class Ex2 extends Exception {}
  7. public interface MyInterface {
  8. public void m() throws Ex1, Ex2;
  9. }
  10. private static class NestedClass1 implements MyInterface {
  11. public void m() throws Ex1 {} // MATCHES HERE
  12. }
  13. private static class NestedClass2 implements MyInterface {
  14. public void m() throws Ex2 {}
  15. }
  16. private static class NestedClassBoth implements MyInterface {
  17. public void m() throws Ex1, Ex2 {} // MATCHES HERE
  18. }
  19. private static class NestedClassNeither implements MyInterface {
  20. public void m() {}
  21. }
  22. }