summaryrefslogtreecommitdiffstats
path: root/tests/new/PR600/My_error.java
blob: a827670ef17862b5befb52bc6a21d9ed9d973297 (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
aspect My_error {

    interface Queue {}
    Queue Queue.next = null; 

    public void Queue.doIt() {
        if (next == null) {
            System.out.println("End of queue reached");
        } else {
            System.out.println("\tCall received  by: "+this.getClass().getName());
            System.out.println("\tCall forwarded to: "+next.getClass().getName());
            next.doIt();
        }
    }

    public void Queue.setNext(Queue next) {
        this.next = next;
    }

    declare parents: A implements Queue;
    declare parents: B implements Queue;
    declare parents: C implements Queue;  

    // This is the problematic declaration. If removed, the program works fine.
    // If replaced by an around advice, the program also works fine.

    public void C.doIt() {
        System.out.println("Hurray! The call has been received by C!");
    }
}