langtools/test/tools/javac/QualifiedThisAndSuper_3.java
author jlahoda
Tue, 16 Aug 2016 16:43:00 +0200
changeset 40504 0a01f6710c84
parent 5520 86e4b9a9da40
permissions -rw-r--r--
8078561: Error message should be generated once when -source 6 is specified Summary: Code to avoid duplicated errors about features not supported in the current source level moved to Log Reviewed-by: jjg
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_3.java
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
 * @run main QualifiedThisAndSuper_3
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
class AS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
    String s = "ass";
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
    private String t = "ast";
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
    protected String u = "asu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
    String m() { return "asm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
    private String n() { return "asn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
    protected String o() { return "aso"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
    static String xs = "xass";
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
    static private String xt = "xast";
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
    static protected String xu = "xasu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
    static String xm() { return "xasm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
    static private String xn() { return "xasn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
    static protected String xo() { return "xaso"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
class BS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    String s = "bss";
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
    private String t = "bst";
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
    protected String u = "bsu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
    String m() { return "bsm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
    private String n() { return "bsn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
    protected String o() { return "bso"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
class CS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    String s = "css";
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
    private String t = "cst";
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
    protected String u = "csu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    String m() { return "csm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    private String n() { return "csn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    protected String o() { return "cso"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
public class QualifiedThisAndSuper_3 extends AS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
    void check(String expr, String result, String expected) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
        if (!result.equals(expected)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
            throw new Error("Evaluated "+ expr +
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
                            " : result " + result + ", expected " + expected);
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    QualifiedThisAndSuper_3() { super(); }
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
    String s = "as";
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    private String t = "at";
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    protected String u = "au";
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    String m() { return "am"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    private String n() { return "an"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    protected String o() { return "ao"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
    static String xs = "xas";
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
    static private String xt = "xat";
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
    static protected String xu = "xau";
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
    static String xm() { return "xam"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
    static private String xn() { return "xan"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
    static protected String xo() { return "xao"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
    public class B extends BS {
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
        B() { super(); }
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
        String s = "bs";
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
        private String t = "bt";
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
        protected String u = "bu";
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
        String m() { return "bm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
        private String n() { return "bn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
        protected String o() { return "bo"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
        public class C extends CS {
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
            C() { super(); }
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
            String s = "cs";
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
            private String t = "ct";
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
            protected String u = "cu";
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
            String m() { return "cm"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
            private String n() { return "cn"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
            protected String o() { return "co"; }
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
            void test() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
                check("QualifiedThisAndSuper_3.super.xm()", QualifiedThisAndSuper_3.super.xm(), "xasm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
                // Private to another package-member class: not accessible
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
                // check("QualifiedThisAndSuper_3.super.xn()", QualifiedThisAndSuper_3.super.xn(), "xasn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
                check("QualifiedThisAndSuper_3.super.xo()", QualifiedThisAndSuper_3.super.xo(), "xaso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
                check("QualifiedThisAndSuper_3.super.xs", QualifiedThisAndSuper_3.super.xs, "xass");
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
                // Private to another package-member class: not accessible
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
                // check("QualifiedThisAndSuper_3.super.xt", QualifiedThisAndSuper_3.super.xt, "xast");
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
                check("QualifiedThisAndSuper_3.super.xu", QualifiedThisAndSuper_3.super.xu, "xasu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
                check("QualifiedThisAndSuper_3.this.xm()", QualifiedThisAndSuper_3.this.xm(), "xam");
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
                check("QualifiedThisAndSuper_3.this.xn()", QualifiedThisAndSuper_3.this.xn(), "xan");
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
                check("QualifiedThisAndSuper_3.this.xo()", QualifiedThisAndSuper_3.this.xo(), "xao");
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
                check("QualifiedThisAndSuper_3.this.xs", QualifiedThisAndSuper_3.this.xs, "xas");
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
                check("QualifiedThisAndSuper_3.this.xt", QualifiedThisAndSuper_3.this.xt, "xat");
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
                check("QualifiedThisAndSuper_3.this.xu", QualifiedThisAndSuper_3.this.xu, "xau");
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
                //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
                check("this.m()", this.m(), "cm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
                check("QualifiedThisAndSuper_3.this.m()", QualifiedThisAndSuper_3.this.m(), "am");
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
                check("B.this.m()", B.this.m(), "bm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
                check("C.this.m()", C.this.m(), "cm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
                check("super.m()", super.m(), "csm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
                check("QualifiedThisAndSuper_3.super.m()", QualifiedThisAndSuper_3.super.m(), "asm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
                check("B.super.m()", B.super.m(), "bsm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
                check("C.super.m()", C.super.m(), "csm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
                // should re-use access methods.
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
                check("QualifiedThisAndSuper_3.super.m()", QualifiedThisAndSuper_3.super.m(), "asm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
                check("B.super.m()", B.super.m(), "bsm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
                check("C.super.m()", C.super.m(), "csm");
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
                //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
                check("this.n()", this.n(), "cn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
                check("QualifiedThisAndSuper_3.this.n()", QualifiedThisAndSuper_3.this.n(), "an");
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
                check("B.this.n()", B.this.n(), "bn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
                check("C.this.n()", C.this.n(), "cn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
                /*****
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
                check("super.n()", super.n(), "csn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
                check("QualifiedThisAndSuper_3.super.n()", QualifiedThisAndSuper_3.super.n(), "asn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
                check("B.super.n()", B.super.n(), "bsn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
                check("C.super.n()", C.super.n(), "csn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
                // should re-use access methods.
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
                check("QualifiedThisAndSuper_3.super.n()", QualifiedThisAndSuper_3.super.n(), "asn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
                check("B.super.n()", B.super.n(), "bsn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
                check("C.super.n()", C.super.n(), "csn");
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
                *****/
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
                //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
                check("this.o()", this.o(), "co");
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
                check("QualifiedThisAndSuper_3.this.o()", QualifiedThisAndSuper_3.this.o(), "ao");
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
                check("B.this.o()", B.this.o(), "bo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
                check("C.this.o()", C.this.o(), "co");
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
                check("super.o()", super.o(), "cso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
                check("QualifiedThisAndSuper_3.super.o()", QualifiedThisAndSuper_3.super.o(), "aso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
                check("B.super.o()", B.super.o(), "bso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
                check("C.super.o()", C.super.o(), "cso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
                // should re-use access methods.
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
                check("QualifiedThisAndSuper_3.super.o()", QualifiedThisAndSuper_3.super.o(), "aso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
                check("B.super.o()", B.super.o(), "bso");
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
                check("C.super.o()", C.super.o(), "cso");
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("this.s", this.s, "cs");
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
                check("QualifiedThisAndSuper_3.this.s", QualifiedThisAndSuper_3.this.s, "as");
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
                check("B.this.s", B.this.s, "bs");
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
                check("C.this.s", C.this.s, "cs");
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("this.t", this.t, "ct");
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
                check("QualifiedThisAndSuper_3.this.t", QualifiedThisAndSuper_3.this.t, "at");
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
                check("B.this.t", B.this.t, "bt");
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
                check("C.this.t", C.this.t, "ct");
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
                check("this.u", this.u, "cu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
                check("QualifiedThisAndSuper_3.this.u", QualifiedThisAndSuper_3.this.u, "au");
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
                check("B.this.u", B.this.u, "bu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
                check("C.this.u", C.this.u, "cu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
                //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
                check("super.s", super.s, "css");
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
                check("QualifiedThisAndSuper_3.super.s", QualifiedThisAndSuper_3.super.s, "ass");
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
                check("B.super.s", B.super.s, "bss");
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
                check("C.super.s", C.super.s, "css");
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
                //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
                /*****
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
                check("super.t", super.t, "cst");
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
                check("QualifiedThisAndSuper_3.super.t", QualifiedThisAndSuper_3.super.t, "ast");
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
                check("B.super.t", B.super.t, "bst");
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
                check("C.super.t", C.super.t, "cst");
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
                *****/
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
                //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
                check("super.u", super.u, "csu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
                check("QualifiedThisAndSuper_3.super.u", QualifiedThisAndSuper_3.super.u, "asu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
                check("B.super.u", B.super.u, "bsu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
                check("C.super.u", C.super.u, "csu");
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
                //---
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
                QualifiedThisAndSuper_3.this.s = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
                System.out.println(QualifiedThisAndSuper_3.this.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
                check("QualifiedThisAndSuper_3.this.s", QualifiedThisAndSuper_3.this.s, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
                B.this.s = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
                System.out.println(B.this.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
                check("B.this.s", B.this.s, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
                C.this.s = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
                System.out.println(C.this.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
                check("C.this.s", C.this.s, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
                QualifiedThisAndSuper_3.this.t = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
                System.out.println(QualifiedThisAndSuper_3.this.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
                check("QualifiedThisAndSuper_3.this.t", QualifiedThisAndSuper_3.this.t, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
                B.this.t = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
                System.out.println(B.this.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
                check("B.this.t", B.this.t, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
                C.this.t = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
                System.out.println(C.this.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
                check("C.this.t", C.this.t, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
                QualifiedThisAndSuper_3.this.u = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
                System.out.println(QualifiedThisAndSuper_3.this.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
                check("QualifiedThisAndSuper_3.this.u", QualifiedThisAndSuper_3.this.u, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
                B.this.u = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
                System.out.println(B.this.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
                check("B.this.u", B.this.u, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
                C.this.u = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
                System.out.println(C.this.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
                check("C.this.u", C.this.u, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
                QualifiedThisAndSuper_3.super.s = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
                System.out.println(QualifiedThisAndSuper_3.super.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
                check("QualifiedThisAndSuper_3.super.s", QualifiedThisAndSuper_3.super.s, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
                B.super.s = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
                System.out.println(B.super.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
                check("B.super.s", B.super.s, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
                C.super.s = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
                System.out.println(C.super.s);
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
                check("C.super.s", C.super.s, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
                /*****
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
                QualifiedThisAndSuper_3.super.t = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
                System.out.println(QualifiedThisAndSuper_3.super.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
                check("QualifiedThisAndSuper_3.super.t", QualifiedThisAndSuper_3.super.t, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
                B.super.t = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
                System.out.println(B.super.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
                check("B.super.t", B.super.t, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
                C.super.t = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
                System.out.println(C.super.t);
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
                check("C.super.t", C.super.t, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
                *****/
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
                QualifiedThisAndSuper_3.super.u = "foo";
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
                System.out.println(QualifiedThisAndSuper_3.super.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
                check("QualifiedThisAndSuper_3.super.u", QualifiedThisAndSuper_3.super.u, "foo");
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
                B.super.u = "bar";
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
                System.out.println(B.super.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
                check("B.super.u", B.super.u, "bar");
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
                C.super.u = "baz";
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
                System.out.println(C.super.u);
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
                check("C.super.u", C.super.u, "baz");
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
        void test() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
            C c = new C();
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
            c.test();
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
    void test() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
        B b = new B();
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
        b.test();
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
    public static void main(String[] args) throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
        QualifiedThisAndSuper_3 a = new QualifiedThisAndSuper_3();
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
        a.test();
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
}