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.

Softener.aj 420B

12345678910111213141516171819202122
  1. import java.sql.SQLException;
  2. public aspect Softener {
  3. // expect this to soften the exception thrown
  4. declare soft: Throwable : execution(* *.run());
  5. }
  6. class SoftenInner {
  7. public static void main(String args[]) {
  8. new SoftenInner().foo();
  9. }
  10. public void foo() {
  11. new Runnable() {
  12. public void run() {
  13. throw new SQLException("test");
  14. }
  15. }.run();
  16. }
  17. }