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.

TryOffEnd.java 698B

12345678910111213141516171819202122232425
  1. import org.aspectj.testing.Tester;
  2. /** @testcase VerifyError after around advice falls off end of tryCatch */
  3. public class TryOffEnd {
  4. public static void main(String[] args) {
  5. Tester.check(new TryOffEnd().error(), "functional failure");
  6. }
  7. public boolean error() {
  8. String s = null;
  9. try {
  10. s = System.getProperty("unknown Property");
  11. } catch (Throwable t) { // CW 13 cannot apply advice
  12. t.printStackTrace(System.err);
  13. }
  14. return true;
  15. }
  16. }
  17. aspect A {
  18. Object around() : within(TryOffEnd) && handler(Throwable) { // CW 21 cannot apply advice
  19. Object result = proceed();
  20. return result;
  21. }
  22. }