aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pureJava/Abstracts.java
blob: 6c4271a0ab115286ad04187de6cef136fca9306e (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
import org.aspectj.testing.Tester;

public class Abstracts {
    static StringBuffer log = new StringBuffer();
    public static void main(String[] args) {
        new D().m();
        Tester.checkEqual(log.toString(), "D.m(), A.m(), A.m(), ");
    }

    public void m() {
        log.append("A.m(), ");
    }
}

abstract class C extends Abstracts {
    public abstract void m();
    public void n() {
        super.m();
    }
}

class D extends C {
    public void m() {
        Abstracts.log.append("D.m(), ");
        super.n();
        n();
    }
}