blob: b05c899a14c5725af73b061f89fc3757b5337575 (
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
|
import java.io.FileNotFoundException;
public aspect MethodCall {
pointcut p() : call(public * C1.m2());
before() throws FileNotFoundException : p() {
throw new FileNotFoundException();
}
pointcut p2() : call(public * C1.m4());
before() : p2() {
}
}
class C1 {
public void m1() throws FileNotFoundException {
new C1().m2();
}
// don't want the 'declared exception not actually
// thrown' warning because the advice is affecting
// this method
public void m2() throws FileNotFoundException {
}
public void m3() throws FileNotFoundException {
new C1().m4();
}
// do want the 'declared exception not actually
// thrown' warning
public void m4() throws FileNotFoundException {
}
}
|