summaryrefslogtreecommitdiffstats
path: root/tests/new/DeclarationCollisionCE.java
blob: 3ad4f4f16842806f3e815c4dde85e5c88012234b (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
/** @testcase expect CE for declaration collision between subaspects instead of domination order */
public class DeclarationCollisionCE {
    public static void main (String[] args) {
        C s = new C();
        System.err.println("title: " + s.title());
    } 
}

class C {}

// bug: dominates clause prevents collision error
abstract aspect AA dominates B { 
    // same result if this line is uncommented
    //public String C.title() { return "[AA] C.title()"; }
}

aspect A extends AA { // implicitly dominates AA
    // dominates AA's declaration, overriding Super.title
    public String C.title() {           // CE 21 collision with B declaration
        return "[A] C.title()" ; 
    }
}

aspect B extends AA { // explicitly dominated by AA ?? --> and hence by A??
    // B fails to dominate AA's declaration, overriding Super.title
    public String C.title() {           // CE 28 collision with A declaration
        return "[B] C.title()" ; 
    }
}