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 564B

12345678910111213141516171819202122232425262728293031
  1. import org.aspectj.testing.Tester;
  2. // PR#290 compiler crashes with eachobject and named pointcuts with parameters
  3. public class Driver {
  4. public static String s = "";
  5. public static void main(String[] args){
  6. new C().go();
  7. Tester.checkEqual(s, "-before-go", "");
  8. }
  9. }
  10. class C {
  11. int x;
  12. public void go() {
  13. Driver.s += "-go";
  14. }
  15. }
  16. aspect A /*of eachobject(A.testPointcut(C))*/ {
  17. pointcut testPointcut(C c): target(c);
  18. before(C c): target(c) && call(* *(..)) {
  19. Driver.s += "-before";
  20. }
  21. }