langtools/test/tools/javap/MethodParameters.java
author hannesw
Tue, 22 Mar 2016 14:23:16 +0100
changeset 36690 06b714373aa4
parent 30846 2b3f379840f0
child 36526 3b41f1c69604
permissions -rw-r--r--
8151810: for-in iteration does not provide per-iteration scope Reviewed-by: attila, lagergren
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 23110
diff changeset
     2
 * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
     4
 *
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
     8
 *
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    13
 * accompanied this code).
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    14
 *
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    18
 *
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    21
 * questions.
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    22
 */
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    23
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    24
/*
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    25
 * @test
15036
b60e18ab9dd7 8005647: langtools/test/tools/javap/MethodParameters.java fails on windows
jjh
parents: 15031
diff changeset
    26
 * @bug 8004727 8005647
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    27
 * @summary javac should generate method parameters correctly.
30846
2b3f379840f0 8074432: Move jdeps and javap to jdk.jdeps module
mchung
parents: 30730
diff changeset
    28
 * @modules jdk.jdeps
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    29
 */
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    30
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    31
import java.io.*;
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    32
import java.util.*;
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    33
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    34
public class MethodParameters {
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    35
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    36
    static final String Foo_name = "Foo";
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    37
    static final String Foo_contents =
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    38
        ("public class Foo {\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    39
         "  Foo() {}\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    40
         "  Foo(int i) {}\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    41
         "  void foo0() {}\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    42
         "  void foo2(int j, int k) {}\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    43
         "}").replaceAll(" +", " ");
16299
05b5bf59c9d3 8008313: 8007052 breaks test/tools/javap/MethodParameters.java
jjg
parents: 15036
diff changeset
    44
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    45
    static final String Init0_expected =
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    46
        ("  Foo();\n" +
16299
05b5bf59c9d3 8008313: 8007052 breaks test/tools/javap/MethodParameters.java
jjg
parents: 15036
diff changeset
    47
         "    descriptor: ()V\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    48
         "    flags:\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    49
         "    Code:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    50
         "      stack=1, locals=1, args_size=1\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    51
         "         0: aload_0\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    52
         "         1: invokespecial #1                  // Method java/lang/Object.\"<init>\":()V\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    53
         "         4: return\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    54
         "      LineNumberTable:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    55
         "        line 2: 0").replaceAll(" +", " ");
16299
05b5bf59c9d3 8008313: 8007052 breaks test/tools/javap/MethodParameters.java
jjg
parents: 15036
diff changeset
    56
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    57
    static final String Init1_expected =
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    58
        ("  Foo(int);\n" +
16299
05b5bf59c9d3 8008313: 8007052 breaks test/tools/javap/MethodParameters.java
jjg
parents: 15036
diff changeset
    59
         "    descriptor: (I)V\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    60
         "    flags:\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    61
         "    Code:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    62
         "      stack=1, locals=2, args_size=2\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    63
         "         0: aload_0\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    64
         "         1: invokespecial #1                  // Method java/lang/Object.\"<init>\":()V\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    65
         "         4: return\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    66
         "      LineNumberTable:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    67
         "        line 3: 0\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    68
         "    MethodParameters:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    69
         "      Name                                Flags\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    70
         "      i").replaceAll(" +", " ");
16299
05b5bf59c9d3 8008313: 8007052 breaks test/tools/javap/MethodParameters.java
jjg
parents: 15036
diff changeset
    71
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    72
    static final String foo0_expected =
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    73
        ("  void foo0();\n" +
16299
05b5bf59c9d3 8008313: 8007052 breaks test/tools/javap/MethodParameters.java
jjg
parents: 15036
diff changeset
    74
         "    descriptor: ()V\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    75
         "    flags:\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    76
         "    Code:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    77
         "      stack=0, locals=1, args_size=1\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    78
         "         0: return\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    79
         "      LineNumberTable:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    80
         "        line 4: 0").replaceAll(" +", " ");
16299
05b5bf59c9d3 8008313: 8007052 breaks test/tools/javap/MethodParameters.java
jjg
parents: 15036
diff changeset
    81
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    82
    static final String foo2_expected =
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    83
        ("  void foo2(int, int);\n" +
16299
05b5bf59c9d3 8008313: 8007052 breaks test/tools/javap/MethodParameters.java
jjg
parents: 15036
diff changeset
    84
         "    descriptor: (II)V\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    85
         "    flags:\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    86
         "    Code:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    87
         "      stack=0, locals=3, args_size=3\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    88
         "         0: return\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    89
         "      LineNumberTable:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    90
         "        line 5: 0\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    91
         "    MethodParameters:\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    92
         "      Name                                Flags\n" +
23110
4d5b75ae3018 8033581: Incorrect comment aligment
jjg
parents: 16299
diff changeset
    93
         "      j\n" +
15031
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    94
         "      k").replaceAll(" +", " ");
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    95
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    96
    static final File classesdir = new File("methodparameters");
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    97
    static final String separator = System.getProperty("line.separator");
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    98
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
    99
    public static void main(String... args) throws Exception {
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   100
        new MethodParameters().run();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   101
    }
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   102
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   103
    void run() throws Exception {
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   104
        classesdir.mkdir();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   105
        final File Foo_java =
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   106
            writeFile(classesdir, Foo_name + ".java", Foo_contents);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   107
        compile("-parameters", "-d", classesdir.getPath(), Foo_java.getPath());
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   108
        System.out.println("Run javap");
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   109
        String output =
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   110
            javap("-c", "-verbose", "-classpath",
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   111
                  classesdir.getPath(), Foo_name);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   112
        String normalized =
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   113
            output.replaceAll(separator, "\n").replaceAll(" +", " ");
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   114
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   115
        if (!normalized.contains(Init0_expected))
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   116
            error("Bad output for zero-parameter constructor.  Expected\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   117
                  Init0_expected + "\n" + "but got\n" + normalized);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   118
        if (!normalized.contains(Init1_expected))
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   119
           error("Bad output for one-parameter constructor.  Expected\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   120
                 Init1_expected + "\n" + "but got\n" + normalized);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   121
        if (!normalized.contains(foo0_expected))
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   122
           error("Bad output for zero-parameter method.  Expected\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   123
                 foo0_expected + "\n" + "but got\n" + normalized);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   124
        if (!normalized.contains(foo2_expected))
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   125
           error("Bad output for two-parameter method  Expected\n" +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   126
                 foo2_expected + "\n" + "but got\n" + normalized);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   127
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   128
        if (0 != errors)
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   129
            throw new Exception("MethodParameters test failed with " +
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   130
                                errors + " errors");
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   131
    }
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   132
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   133
    String javap(String... args) {
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   134
        StringWriter sw = new StringWriter();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   135
        PrintWriter out = new PrintWriter(sw);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   136
        //sun.tools.javap.Main.entry(args);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   137
        int rc = com.sun.tools.javap.Main.run(args, out);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   138
        if (rc != 0)
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   139
            throw new Error("javap failed. rc=" + rc);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   140
        out.close();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   141
        System.out.println(sw);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   142
        return sw.toString();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   143
    }
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   144
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   145
    String compile(String... args) throws Exception {
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   146
        System.err.println("compile: " + Arrays.asList(args));
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   147
        StringWriter sw = new StringWriter();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   148
        PrintWriter pw = new PrintWriter(sw);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   149
        int rc = com.sun.tools.javac.Main.compile(args, pw);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   150
        pw.close();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   151
        String out = sw.toString();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   152
        if (out.length() > 0)
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   153
            System.err.println(out);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   154
        if (rc != 0)
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   155
            error("compilation failed, rc=" + rc);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   156
        return out;
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   157
    }
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   158
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   159
    File writeFile(File dir, String path, String body) throws IOException {
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   160
        File f = new File(dir, path);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   161
        f.getParentFile().mkdirs();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   162
        FileWriter out = new FileWriter(f);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   163
        out.write(body);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   164
        out.close();
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   165
        return f;
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   166
    }
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   167
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   168
    void error(String msg) {
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   169
        System.err.println("Error: " + msg);
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   170
        errors++;
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   171
    }
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   172
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   173
    int errors;
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   174
c4fad55a5681 8004727: Add compiler support for parameter reflection
jjg
parents:
diff changeset
   175
}