blob: 056443e8bffe335ac9ace3ced56c02402f2d02fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package tjpStaticPart;
import java.io.*;
import org.aspectj.lang.*;
public aspect Exceptions {
pointcut exceptionMethods () :
call(java.io.*.new(..) throws FileNotFoundException);
Object around () throws FileNotFoundException : exceptionMethods() && !within(Exceptions) {
System.err.println("before: " + thisJoinPoint.getStaticPart());
Object obj = proceed();
System.err.println("after: " + thisJoinPoint.getStaticPart());
return obj;
}
}
|