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.

123456789101112131415161718192021
  1. import org.aspectj.testing.Tester;
  2. import org.aspectj.testing.Tester;
  3. /** @testcase PR#573 pertarget stack overflow getting name of anonymous class (runtime overflow) */
  4. public class PR573_2 {
  5. static public void main(String[] params) {
  6. final Object o = new Object() {
  7. public void m() { }};
  8. Tester.expectEvent("A.init0");
  9. Tester.check(null != o, "null != o");
  10. Tester.check(1 == A.num, "1 == A.num: " + A.num);
  11. Tester.checkAllEvents();
  12. }
  13. }
  14. // different stack overflow when using Object, not Interface
  15. //aspect A pertarget(target(Object)) {
  16. aspect A pertarget(target(Object) && !target(A)) {
  17. public static int num;
  18. A(){ Tester.event("A.init" + num++); }
  19. }