You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SampleExceptionHandling1.java 601B

123456789101112131415161718192021
  1. public class SampleExceptionHandling1 {
  2. public void mumble() throws java.io.IOException { } // CE expected
  3. }
  4. /** @author Ron Bodkin */
  5. aspect Library {
  6. public pointcut executionsThrowingChecked() :
  7. execution(* *(..) throws (Exception+ && !RuntimeException));
  8. }
  9. /** @author Ron Bodkin */
  10. aspect SampleExceptionHandling {
  11. public pointcut scope() : within(SampleExceptionHandling1);
  12. public pointcut executionsThrowingChecked() :
  13. Library.executionsThrowingChecked() && scope();
  14. declare error : executionsThrowingChecked():
  15. "no checked exceptions";
  16. }