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.

12345678910111213141516171819202122232425
  1. import org.aspectj.testing.Tester;
  2. import org.aspectj.testing.Tester;
  3. /** @testcase PR#573 pertarget stack overflow getting name of anonymous class */
  4. public class PR573 {
  5. static public void main(String[] params) {
  6. Tester.expectEvent("A.init0");
  7. final Object o = new Interface() {
  8. public void m(Object oa) {
  9. oa.toString();
  10. }};
  11. Tester.check(null != o, "null != o");
  12. ((Interface) o).m("hi"); // no exceptions
  13. Tester.check(1 == A.num, "1 == A.num: " + A.num);
  14. Tester.checkAllEvents();
  15. }
  16. }
  17. interface Interface { void m(Object o);}
  18. aspect A pertarget(target(Interface)) { // was a warning in 1.0
  19. public static int num;
  20. A(){ Tester.event("A.init" + num++); }
  21. }