blob: 2ff882ab589d615d672ea6afedcd96e01b130e07 (
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
|
public class MultiCatchAspect {
public static void main(String[] args) {
}
}
aspect X {
before(): execution(* main(..)) {
try {
foo("abc");
} catch (ExceptionA | ExceptionB ex) {
bar(ex);
}
}
public static void bar(Exception ea) {
}
public static void foo(String s) throws ExceptionA, ExceptionB {
if (s.equals("ta")) {
throw new ExceptionA();
} else {
throw new ExceptionB();
}
}
}
@SuppressWarnings("serial")
class ExceptionA extends Exception {
}
@SuppressWarnings("serial")
class ExceptionB extends Exception {
}
|