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.

SoftWithin.java 591B

123456789101112131415161718192021222324252627282930313233
  1. import org.aspectj.testing.Tester;
  2. import org.aspectj.lang.*;
  3. import java.io.*;
  4. /** @testcase Bugzilla Bug 29691
  5. Static inner aspects cannot reference user defined pointcuts
  6. */
  7. public class SoftWithin {
  8. static void foo() throws IOException {
  9. throw new IOException();
  10. }
  11. public static void main(String[] args) throws Exception{
  12. try {
  13. foo();
  14. } catch (SoftException se) {
  15. return;
  16. }
  17. Tester.checkFailed("should have got SoftException");
  18. }
  19. }
  20. aspect Soften {
  21. declare soft : IOException : within(SoftWithin);
  22. }