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

public aspect Initialization {

	pointcut preInit() : preinitialization(C.new(String));
	
	before() throws FileNotFoundException : preInit() {
		throw new FileNotFoundException();
	}
	
	pointcut init() : initialization(C.new());
	
	before() throws FileNotFoundException : init() {
		throw new FileNotFoundException();
	}
}

class C {
	
	// shouldn't get a warning against this constructor  
	// since the throwing is handled by the advice
	public C() throws FileNotFoundException {
	}
	
	// shouldn't get a warning against this constructor
	// since the throwing is handled by the advice
	public C(String s) throws FileNotFoundException {
	}
	
}