summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/LocalsFromInnerCE.java
blob: e8958716d261e583b29bb2f1953af287053b55bf (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/** @testcase PUREJAVA PR#739 local variables must be final to be accessed from inner class */
class LocalsFromInnerCE {
    void f() {
        int i = 0;
        new Runnable() {
                public void run() { i++; } // CE 6 nonfinal variable
            }.run();
    }

    static void sf() {
        int i = 0;
        new Runnable() {
                public void run() { i++; } // CE 13 nonfinal variable
            }.run();
    }

    void f(int i) {
        new Runnable() {
                public void run() { i++; } // CE 19 nonfinal variable
            }.run();
    }

    static void sf(int i) {
        new Runnable() {
                public void run() { i++; } // CE 25 nonfinal variable
            }.run();
    }

    static {
        int i = 0;
        new Runnable() {
                public void run() { i++; } // CE 32 nonfinal variable
            }.run();
    }

    void m(int i) {
        class m {
            void f(int i) {
                new Runnable() {
                        public void run() { i++; } // CE 40 nonfinal variable
                    }.run();
            }
        }
    }

    void m() {
        int i = 0;
        class m {
            void f() {
                new Runnable() {
                        public void run() { i++; } // CE 51 nonfinal variable
                    }.run();
            }
        }
    }

    class m {
        void f() {
            int i = 0;
            new Runnable() {
                    public void run() { i++; } // CE 61 nonfinal variable
                }.run();
        }
 
        void f(int i) {
            new Runnable() {
                    public void run() { i++; } // CE 67 nonfinal variable
                }.run();
        }
    }

    LocalsFromInnerCE() {
        int i = 0;
            new Runnable() {
                    public void run() { i++; } // CE 75 nonfinal variable
                }.run();
    }

    LocalsFromInnerCE(int i) {
            new Runnable() {
                    public void run() { i++; } // CE 81 nonfinal variable
                }.run();
    }
}