Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. public class Handler {
  2. public static void main(String[] args) {
  3. m();
  4. }
  5. // public static void m() {
  6. // while(true) {
  7. // foo: {try {
  8. // int x = 2+3;
  9. // if (x >3) break foo;
  10. // x = x+10;
  11. // //return;
  12. // } catch (Throwable t) {
  13. // System.err.println(t);
  14. // }}
  15. // System.out.println("still in loop");
  16. // }
  17. // //System.out.println("outside");
  18. //
  19. // }
  20. public static void m() {
  21. try {
  22. int x = 0;
  23. int y = 3/x;
  24. throw new RuntimeException("shouldn't be here");
  25. } catch (Throwable t) {
  26. return;
  27. }
  28. }
  29. public void m1(int x) {
  30. boolean b = true;
  31. if (b) {
  32. m();
  33. } else {
  34. m();
  35. }
  36. }
  37. }
  38. aspect A {
  39. before(Throwable t): handler(Throwable) && args(t) {
  40. System.out.println("caught " + t + " at " + thisJoinPointStaticPart);
  41. }
  42. // before(int i): cflow(execution(void m1(int)) && args(i)) && call(void m()) {
  43. // System.out.println("i");
  44. // }
  45. }