summaryrefslogtreecommitdiffstats
path: root/tests/new/protectedStatic/SubClass.java
blob: d2caf89eb31a8ea1b16a3183e8e35ab514635f10 (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 pack.SuperClass;
import org.aspectj.testing.Tester; 

/** @testcase PR#585 PUREJAVA subclass unable to access protected static methods using type-qualified references */
public class SubClass extends SuperClass {
    private static int i;
    static {
        while (i<6) { 
            Tester.expectEvent(label() + SuperClass.SUPERCLASS);
        }
        i = 0;
    }
    static void register(Object o) {
        Tester.event(""+o);
    }

    public static String label() { return "label() " + i++; }
    public static void main(String[] args) {
        Object o = protectedStaticObject;
        register(""+protectedStatic(label() + o));
        register(""+SuperClass.protectedStatic(label() + o));
        register(""+pack.SuperClass.protectedStatic(label() + o));
        new SubClass().run();
        Tester.checkAllEvents();
    }
    public void run() {
        Object o = protectedObject;
        register(label() + protectedObject);
        register(""+protectedMethod(label()+o));
        register(""+this.protectedMethod(label()+o));
    }
}