aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/testdata/src1/DeclareSoft.java
blob: b42a824532cca6734c559f54bf3ae55857229642 (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
import java.io.*;
import org.aspectj.lang.*;

public class DeclareSoft {
	public static void main(String[] args) {
		try {
			new DeclareSoft().m();
		} catch (SoftException se) {
			return;
		}
	}
	
	void m() {
		InputStream s = new FileInputStream("foobar");
		s.close();
	}
}


aspect A {
	//declare soft: IOException: execution(void m());
	
	declare soft: IOException: foo();
	
	pointcut foo(): execution(void m());
}