mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-09 14:14:28 +02:00
27 lines
422 B
Java
27 lines
422 B
Java
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());
|
|
}
|