aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/TypeNames.java
blob: 6e87580564e1e0571309d1e8355614a9f7b97bc3 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import org.aspectj.testing.Tester; 

/** @testcase package typepattern with no packages (in default package) */
public class TypeNames {
    public static void main (String[] args) {
        new Suffix().run();
        new MySuffix().run();
        Tester.checkAllEvents();
    } 
    static {
        Tester.expectEvent("Suffix.run()");
        Tester.expectEvent("MySuffix.run()");
    }
}

// classes not to be matched by TypePattern below
class Suffix { 
    void run() {
        Tester.event("Suffix.run()");
    } 
}

class MySuffix { 
    void run() {
          Tester.event("MySuffix.run()");
    } 
}



aspect A {
    // BUG: This is all that's required to provoke the bug in -Xlint mode
    declare parents: *..*Suffix implements Runnable;  // lint: no type matched
 
 

    // coverage cases
    before() : staticinitialization(*..*Suffix) { // lint: no type matched
        Tester.check(false, "no such join point");
    }

    before() : call(void *..*Suffix.run()) { // lint: no type matched
        Tester.check(false, "no such join point");
    }

    before() : call(*..*Suffix.new()) { // lint: no type matched
        Tester.check(false, "no such join point");
    }
}