langtools/test/tools/javac/QualifiedThisAndSuper_1.java
author lana
Thu, 21 Jan 2016 09:46:01 -0800
changeset 35340 38f7386ed942
parent 5520 86e4b9a9da40
permissions -rw-r--r--
Added tag jdk-9+102 for changeset 7e3feb2ba5b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
     2
 * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    21
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
 * @test
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
 * @bug 4147520
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
 * @summary Verify correct implementation of qualified 'this' and 'super'.
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
 * @author maddox
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
 * @run compile QualifiedThisAndSuper_1.java
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
 * @run main QualifiedThisAndSuper_1
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
public class QualifiedThisAndSuper_1 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
    public class AS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
        String s = "ass";
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
        private String t = "ast";
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
        protected String u = "asu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
        String m() { return "asm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
        private String n() { return "asn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
        protected String o() { return "aso"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
    public class BS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
        String s = "bss";
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
        private String t = "bst";
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
        protected String u = "bsu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
        String m() { return "bsm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
        private String n() { return "bsn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
        protected String o() { return "bso"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
    public class CS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
        String s = "css";
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
        private String t = "cst";
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
        protected String u = "csu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
        String m() { return "csm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
        private String n() { return "csn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
        protected String o() { return "cso"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    void check(String expr, String result, String expected) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
        if (!result.equals(expected)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
            throw new Error("Evaluated "+ expr +
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
                            " : result " + result + ", expected " + expected);
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
    public class A extends AS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
        A() { super(); }
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
        String s = "as";
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
        private String t = "at";
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
        protected String u = "au";
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
        String m() { return "am"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
        private String n() { return "an"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
        protected String o() { return "ao"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
        public class B extends BS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
            B() { super(); }
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
            String s = "bs";
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
            private String t = "bt";
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
            protected String u = "bu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
            String m() { return "bm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
            private String n() { return "bn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
            protected String o() { return "bo"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
            public class C extends CS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
                C() { super(); }
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
                String s = "cs";
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
                private String t = "ct";
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
                protected String u = "cu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
                String m() { return "cm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
                private String n() { return "cn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
                protected String o() { return "co"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
                void test() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
                    check("this.m()", this.m(), "cm");
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
                    check("A.this.m()", A.this.m(), "am");
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
                    check("B.this.m()", B.this.m(), "bm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
                    check("C.this.m()", C.this.m(), "cm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
                    check("super.m()", super.m(), "csm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
                    check("A.super.m()", A.super.m(), "asm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
                    check("B.super.m()", B.super.m(), "bsm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
                    check("C.super.m()", C.super.m(), "csm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
                    // should re-use access methods.
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
                    check("A.super.m()", A.super.m(), "asm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
                    check("B.super.m()", B.super.m(), "bsm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
                    check("C.super.m()", C.super.m(), "csm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
                    //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
                    check("this.n()", this.n(), "cn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
                    check("A.this.n()", A.this.n(), "an");
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
                    check("B.this.n()", B.this.n(), "bn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
                    check("C.this.n()", C.this.n(), "cn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
                    check("super.n()", super.n(), "csn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
                    check("A.super.n()", A.super.n(), "asn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
                    check("B.super.n()", B.super.n(), "bsn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
                    check("C.super.n()", C.super.n(), "csn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
                    // should re-use access methods.
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
                    check("A.super.n()", A.super.n(), "asn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
                    check("B.super.n()", B.super.n(), "bsn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
                    check("C.super.n()", C.super.n(), "csn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
                    //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
                    check("this.o()", this.o(), "co");
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
                    check("A.this.o()", A.this.o(), "ao");
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
                    check("B.this.o()", B.this.o(), "bo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
                    check("C.this.o()", C.this.o(), "co");
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
                    check("super.o()", super.o(), "cso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
                    check("A.super.o()", A.super.o(), "aso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
                    check("B.super.o()", B.super.o(), "bso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
                    check("C.super.o()", C.super.o(), "cso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
                    // should re-use access methods.
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
                    check("A.super.o()", A.super.o(), "aso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
                    check("B.super.o()", B.super.o(), "bso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
                    check("C.super.o()", C.super.o(), "cso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
                    //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
                    check("this.s", this.s, "cs");
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
                    check("A.this.s", A.this.s, "as");
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
                    check("B.this.s", B.this.s, "bs");
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
                    check("C.this.s", C.this.s, "cs");
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
                    //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
                    check("this.t", this.t, "ct");
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
                    check("A.this.t", A.this.t, "at");
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
                    check("B.this.t", B.this.t, "bt");
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
                    check("C.this.t", C.this.t, "ct");
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
                    //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
                    check("this.u", this.u, "cu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
                    check("A.this.u", A.this.u, "au");
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
                    check("B.this.u", B.this.u, "bu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
                    check("C.this.u", C.this.u, "cu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
                    //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
                    check("super.s", super.s, "css");
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
                    check("A.super.s", A.super.s, "ass");
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
                    check("B.super.s", B.super.s, "bss");
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
                    check("C.super.s", C.super.s, "css");
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
                    //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
                    check("super.t", super.t, "cst");
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
                    check("A.super.t", A.super.t, "ast");
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
                    check("B.super.t", B.super.t, "bst");
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
                    check("C.super.t", C.super.t, "cst");
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
                    //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
                    check("super.u", super.u, "csu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
                    check("A.super.u", A.super.u, "asu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
                    check("B.super.u", B.super.u, "bsu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
                    check("C.super.u", C.super.u, "csu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
                    //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
                    A.this.s = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
                    System.out.println(A.this.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
                    check("A.this.s", A.this.s, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
                    B.this.s = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
                    System.out.println(B.this.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
                    check("B.this.s", B.this.s, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
                    C.this.s = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
                    System.out.println(C.this.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
                    check("C.this.s", C.this.s, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
                    A.this.t = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
                    System.out.println(A.this.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
                    check("A.this.t", A.this.t, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
                    B.this.t = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
                    System.out.println(B.this.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
                    check("B.this.t", B.this.t, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
                    C.this.t = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
                    System.out.println(C.this.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
                    check("C.this.t", C.this.t, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
                    A.this.u = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
                    System.out.println(A.this.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
                    check("A.this.u", A.this.u, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
                    B.this.u = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
                    System.out.println(B.this.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
                    check("B.this.u", B.this.u, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
                    C.this.u = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
                    System.out.println(C.this.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
                    check("C.this.u", C.this.u, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
                    A.super.s = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
                    System.out.println(A.super.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
                    check("A.super.s", A.super.s, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
                    B.super.s = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
                    System.out.println(B.super.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
                    check("B.super.s", B.super.s, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
                    C.super.s = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
                    System.out.println(C.super.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
                    check("C.super.s", C.super.s, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
                    A.super.t = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
                    System.out.println(A.super.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
                    check("A.super.t", A.super.t, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
                    B.super.t = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
                    System.out.println(B.super.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
                    check("B.super.t", B.super.t, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
                    C.super.t = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
                    System.out.println(C.super.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
                    check("C.super.t", C.super.t, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
                    A.super.u = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
                    System.out.println(A.super.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
                    check("A.super.u", A.super.u, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
                    B.super.u = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
                    System.out.println(B.super.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
                    check("B.super.u", B.super.u, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
                    C.super.u = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
                    System.out.println(C.super.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
                    check("C.super.u", C.super.u, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
            void test() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
                C c = new C();
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
                c.test();
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
        void test() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
            B b = new B();
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
            b.test();
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
    public static void main(String[] args) throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
        A a = new QualifiedThisAndSuper_1().new A();
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
        a.test();
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
}