Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

AdviceInteraction.java 546B

12345678910111213141516171819202122232425
  1. public class AdviceInteraction {
  2. public static void main(String [] args) {
  3. new C().m1();
  4. }
  5. }
  6. class C {
  7. public void m1() {}
  8. public void m2() {}
  9. }
  10. aspect A {
  11. pointcut exec1(C c): this(c) && execution(void m1());
  12. pointcut execs(C c): exec1(c);
  13. before (): execs(*) {}
  14. before (C c): execs(c) {}
  15. // This ordering works correctly
  16. pointcut exec2(C c): this(c) && execution(void m2());
  17. pointcut execs2(C c): exec2(c);
  18. before (C c): execs2(c) {}
  19. before (): execs2(*) {}
  20. }