aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/EmptyInterfaceCE.java
blob: 4fdbbed33fe82d10db2318186b6b2b4008484b90 (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
import org.aspectj.testing.Tester;

/** @testcase PR#36778 advise join points in subclass of empty interface */
public class EmptyInterfaceCE {

    public static void main(String[] args) {
        new C().go();
        // at least constructor and method execution
        if (2 > Log.hits) {
            Tester.check(false, Log.log.toString());
        }
    }
}

aspect Log {
    static int hits;
    static StringBuffer log = new StringBuffer();
    interface LoggedType {
    }
    declare parents: C implements LoggedType;
    void around() : staticinitialization(LoggedType) // CE: limitation
        {
        hits++;
        log.append(thisJoinPoint + ";");
    }
}

class C {
    void go() {}
}