aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs152/pr129282/InnerMethodCall2.aj
blob: 202bf8806a1f11ba9408d3f9caf6ae91296d6a22 (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
import java.io.FileNotFoundException;

aspect InnerMethodCall2 {
	
	pointcut p() : call(* C1.c1Method());
	
	before() throws FileNotFoundException : p() {
		throw new FileNotFoundException();
	}
	
}

class MainClass {
	
	public void amethod() {
		new C() {
			public void mymethod() throws FileNotFoundException {
				new C() {
					public void mymethod() throws FileNotFoundException {
						new C1().c1Method();
					}
				};
			}
		};
	}
	
}

class C1 {
	
	// don't want the 'declared exception not actually thrown'
	// exception because the advice is effectively throwing it
	public void c1Method() throws FileNotFoundException {
	}
	
}

abstract class C {
	public abstract void mymethod() throws FileNotFoundException;
}