Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ComputedThrows.java 667B

12345678910111213141516171819202122232425262728
  1. import org.aspectj.testing.Tester;
  2. public class ComputedThrows {
  3. public static void main(String[] args) { test(); }
  4. public static void test() {
  5. new ComputedThrows().bar();
  6. Tester.check("ran bar");
  7. Tester.check("caught Exception");
  8. }
  9. void bar() throws Exception {
  10. Tester.note("ran bar");
  11. throw new Exception();
  12. }
  13. }
  14. aspect Aspect {
  15. pointcut Foo(): within(ComputedThrows) && call(* ComputedThrows.bar(..));
  16. declare soft: Exception: Foo();
  17. void around(): Foo() {
  18. try {
  19. proceed();
  20. } catch (Exception e) {
  21. Tester.note("caught Exception");
  22. }
  23. }
  24. }