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.

LocalInner.java 614B

12345678910111213141516171819
  1. import org.aspectj.testing.*;
  2. public class LocalInner {
  3. public static void main(String[] args) {
  4. class Local implements Runnable {
  5. public void run() {}
  6. }
  7. Local local = new Local();
  8. local.run();
  9. Tester.checkAllEvents();
  10. }
  11. }
  12. aspect Aspect {
  13. pointcut local(): callsto(receptions(void run()) && instanceof(Runnable));
  14. static before(): local() { Tester.event("before-run"); }
  15. static after(): local() { Tester.event("after-run"); }
  16. static around() returns void: local() { Tester.event("around-run"); proceed(); }
  17. }