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.

AroundCall.java 776B

12345678910111213141516171819202122232425262728
  1. import org.aspectj.testing.*;
  2. public class AroundCall {
  3. void a(int nullm) { b(); }
  4. void b() {
  5. Tester.check(false, "around failed");
  6. }
  7. public static void main(String[] args) {
  8. AroundCall t = new AroundCall();
  9. t.a(42);
  10. Tester.checkAllEvents();
  11. }
  12. static {
  13. Tester.expectEvent("around");
  14. }
  15. }
  16. aspect TestAspect {
  17. /** @testcase PR#666 name binding in around cflow */
  18. void around(final int n) : // no bug if before advice
  19. cflow(execution(void AroundCall.a(int)) && args(n)) // no bug if no args
  20. && target(AroundCall) && !initialization(new(..))
  21. {
  22. Tester.event("around");
  23. if (n > 100) proceed(n); // some bugs hidden without call to proceed
  24. }
  25. }