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.

CannotReferenceSuper.java 713B

12345678910111213141516171819202122232425262728293031323334
  1. import org.aspectj.testing.*;
  2. public class CannotReferenceSuper {
  3. public static void main(String[] args) {
  4. new CannotReferenceSuper().go();
  5. }
  6. static {
  7. Tester.expectEventsInString("a.go,aa.go,b.go,bb.go");
  8. }
  9. void go() {
  10. new A().go();
  11. new B().go();
  12. Tester.checkAllEvents();
  13. }
  14. class A {
  15. class AA extends A {
  16. void go() { Tester.event("aa.go"); }
  17. }
  18. void go() { Tester.event("a.go"); new AA().go(); }
  19. }
  20. class B extends A {
  21. class BB extends AA {
  22. void go() { Tester.event("bb.go"); }
  23. }
  24. void go() { Tester.event("b.go"); new BB().go(); }
  25. }
  26. }