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