aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/CannotReferenceSuper.java
blob: 3ce4e04d00c49dc5f7e0a4b2ce201997b259197e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import org.aspectj.testing.*;
public class CannotReferenceSuper {

    public static void main(String[] args) {
        new CannotReferenceSuper().go();
    }

    static {
        Tester.expectEventsInString("a.go,aa.go,b.go,bb.go");
    }

    void go() {
        new A().go();
        new B().go();
        Tester.checkAllEvents();
    }
    
    class A {
        class AA extends A {
            void go() { Tester.event("aa.go"); }
        }
        void go() { Tester.event("a.go"); new AA().go(); }
    }

    class B extends A {        
        class BB extends AA {
            void go() { Tester.event("bb.go"); }
        }
        void go() { Tester.event("b.go"); new BB().go(); }
        
    }
}