blob: f63e551d51865f423bbf284aa15cb670eae7662b (
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
|
import java.io.FileNotFoundException;
public aspect MethodCallInDiffClass {
pointcut p() : call(public * B1.m2());
before() throws FileNotFoundException : p() {
throw new FileNotFoundException();
}
}
class B {
public void m1() throws FileNotFoundException {
new B1().m2();
}
}
class B1 {
// don't want the 'declared exception not acutally
// thrown' warning since the advice is throwing it
public void m2() throws FileNotFoundException {
}
}
|