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.

AdviceExec.java 656B

12345678910111213141516171819202122232425262728293031
  1. // for Bug#: 31423
  2. import org.aspectj.testing.Tester;
  3. public class AdviceExec {
  4. public static void main(String[] args) {
  5. Tester.checkEqual(Aspect1.ran, 2, "Aspect1 ran");
  6. Tester.checkEqual(Aspect2.ran, 2, "Aspect2 ran");
  7. }
  8. }
  9. aspect Aspect1 {
  10. static int ran = 0;
  11. before() : execution(* AdviceExec.*(..)) {
  12. //System.out.println("Reached " + thisJoinPoint);
  13. ran++;
  14. }
  15. void around(): execution(* AdviceExec.*(..)) {
  16. ran++;
  17. proceed();
  18. }
  19. }
  20. aspect Aspect2 {
  21. static int ran = 0;
  22. before() : adviceexecution() && !within(Aspect2) {
  23. //System.out.println("Reached " + thisJoinPoint);
  24. ran++;
  25. }
  26. }