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.

Driver.java 613B

123456789101112131415161718192021222324
  1. import org.aspectj.testing.Tester;
  2. // PR#262
  3. import org.aspectj.testing.Tester;
  4. public aspect Driver /*of eachobject(instanceof(CallsTo))*/ {
  5. public static void test() { main(null); }
  6. public static void main(String[] args) {
  7. CallsTo ct = new CallsTo();
  8. Tester.checkEqual(ct.a(), "s", "after calls");
  9. }
  10. pointcut call1(): call(* CallsFrom.b(..)) && within(CallsTo);
  11. before(): call1() {
  12. //System.out.println("before-call1");
  13. }
  14. }
  15. class CallsTo { public String a() { return new CallsFrom().b("s"); } }
  16. class CallsFrom { public String b(String s) { return s; } }