aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs152/pr129282/InnerMethodCall.aj
blob: ed1f54c3d38dcd4cbf01828b5785958d83e726b8 (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
51
52
import java.io.FileNotFoundException;

public aspect InnerMethodCall {

	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() {
		new C2() {
			public void m6() 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() {
		new C2() {
			public void m6() throws FileNotFoundException {
				new C1().m4();
			}
		};
	}
	
	// do want the 'declared exception not actually
	// thrown' warning
	public void m4() throws FileNotFoundException {
	}
	
	
}

abstract class C2 {
	public abstract void m6() throws FileNotFoundException;
}