summaryrefslogtreecommitdiffstats
path: root/tests/base/test129/Driver.java
blob: 6a2f7c04b2c258ccd55d3799fc7b7a93b12e694a (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.Tester;

public class Driver {
    public static void main(String[] args) { test(); }
  
    public static void test() {
        AbstractC aC = new C();
        Tester.checkEqual(aC.foo(), 42, "introduced abstract");
        Tester.checkEqual(((I)aC).bar(), 12, "introduced on interface");
    }
}

interface I {
}

abstract class AbstractC implements I {
}

class C extends AbstractC {
}

aspect A {
    //introduction AbstractC {
    abstract int AbstractC.foo();
    //}

    //introduction C {
    int C.foo() { return 42; }
    //}

    //introduction I {
    public int I.bar() { return 12; }
    //}
}