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.

ArgsInCflow2.java 595B

12345678910111213141516171819202122232425
  1. import org.aspectj.testing.*;
  2. /** PR#660 name binding in around cflow */
  3. public class ArgsInCflow2 {
  4. public static void main(String[] args) {
  5. Tester.check(3==foo(1), "3==foo(1)");
  6. Tester.checkAllEvents();
  7. }
  8. static int foo(int x) {return bar(x+1);}
  9. static int bar(int x) {return x+1;}
  10. static {
  11. Tester.expectEvent("1-2");
  12. }
  13. }
  14. aspect Test {
  15. int around(final int x, final int y) :
  16. cflow(call(int foo(int)) && args(x))
  17. && call(int bar(int)) && args(y) {
  18. Tester.event(x + "-" + y);
  19. return proceed(x,y);
  20. }
  21. }