選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Exceptions.java 460B

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