src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java
author goetz
Tue, 16 Jan 2018 08:48:34 +0100
changeset 48543 7067fe4e054e
parent 47216 71c04702a3d5
child 50603 95c0644a1c47
permissions -rw-r--r--
8189102: All tools should support -?, -h and --help Reviewed-by: kvn, jjg, weijun, alanb, rfield, ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
48543
7067fe4e054e 8189102: All tools should support -?, -h and --help
goetz
parents: 47216
diff changeset
     2
 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * accompanied this code).
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    23
 * questions.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    24
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    25
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    26
package sun.tools.jar;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    27
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    28
import java.io.File;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    29
import java.io.PrintStream;
41484
834b7539ada3 8164689: Retrofit jar, jlink, jmod as a ToolProvider
mchung
parents: 40261
diff changeset
    30
import java.io.PrintWriter;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    31
import java.lang.module.ModuleFinder;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    32
import java.lang.module.ModuleDescriptor.Version;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    33
import java.nio.file.Path;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    34
import java.nio.file.Paths;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    35
import java.util.regex.Pattern;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    36
import java.util.regex.PatternSyntaxException;
43109
fe275140c3f1 8160286: jmod hash is creating unlinkable modules
mchung
parents: 43095
diff changeset
    37
fe275140c3f1 8160286: jmod hash is creating unlinkable modules
mchung
parents: 43095
diff changeset
    38
import jdk.internal.module.ModulePath;
42703
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
    39
import jdk.internal.module.ModuleResolution;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    40
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    41
/**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    42
 * Parser for GNU Style Options.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    43
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    44
class GNUStyleOptions {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    45
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    46
    static class BadArgs extends Exception {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    47
        static final long serialVersionUID = 0L;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    48
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    49
        boolean showUsage;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    50
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    51
        BadArgs(String key, String arg) { super(Main.formatMsg(key, arg)); }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    52
        BadArgs(String key) { super(Main.getMsg(key)); }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    53
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    54
        BadArgs showUsage(boolean b) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    55
            showUsage = b;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    56
            return this;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    57
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    58
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    59
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    60
    static Option[] recognizedOptions = {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    61
            // Main operations
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    62
            new Option(false, OptionType.MAIN_OPERATION, "--create", "-c") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    63
                void process(Main tool, String opt, String arg) throws BadArgs {
42463
39c0bbf9d03c 8170952: jar's usage message output need some cleanup
sherman
parents: 41489
diff changeset
    64
                    if (tool.iflag || tool.tflag || tool.uflag || tool.xflag || tool.dflag)
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    65
                        throw new BadArgs("error.multiple.main.operations").showUsage(true);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    66
                    tool.cflag = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    67
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    68
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    69
            new Option(true, OptionType.MAIN_OPERATION, "--generate-index", "-i") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    70
                void process(Main tool, String opt, String arg) throws BadArgs {
42463
39c0bbf9d03c 8170952: jar's usage message output need some cleanup
sherman
parents: 41489
diff changeset
    71
                    if (tool.cflag || tool.tflag || tool.uflag || tool.xflag || tool.dflag)
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    72
                        throw new BadArgs("error.multiple.main.operations").showUsage(true);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    73
                    tool.iflag = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    74
                    tool.rootjar = arg;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    75
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    76
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    77
            new Option(false, OptionType.MAIN_OPERATION, "--list", "-t") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    78
                void process(Main tool, String opt, String arg) throws BadArgs {
42463
39c0bbf9d03c 8170952: jar's usage message output need some cleanup
sherman
parents: 41489
diff changeset
    79
                    if (tool.cflag || tool.iflag || tool.uflag || tool.xflag || tool.dflag)
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    80
                        throw new BadArgs("error.multiple.main.operations").showUsage(true);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    81
                    tool.tflag = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    82
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    83
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    84
            new Option(false, OptionType.MAIN_OPERATION, "--update", "-u") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    85
                void process(Main tool, String opt, String arg) throws BadArgs {
42463
39c0bbf9d03c 8170952: jar's usage message output need some cleanup
sherman
parents: 41489
diff changeset
    86
                    if (tool.cflag || tool.iflag || tool.tflag || tool.xflag || tool.dflag)
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    87
                        throw new BadArgs("error.multiple.main.operations").showUsage(true);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    88
                    tool.uflag = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    89
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    90
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    91
            new Option(false, OptionType.MAIN_OPERATION, "--extract", "-x") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    92
                void process(Main tool, String opt, String arg) throws BadArgs {
42463
39c0bbf9d03c 8170952: jar's usage message output need some cleanup
sherman
parents: 41489
diff changeset
    93
                    if (tool.cflag || tool.iflag  || tool.tflag || tool.uflag || tool.dflag)
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    94
                        throw new BadArgs("error.multiple.main.operations").showUsage(true);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    95
                    tool.xflag = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    96
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    97
            },
44267
00898a596f31 8176772: jar tool support to report automatic module names
chegar
parents: 43805
diff changeset
    98
            new Option(false, OptionType.MAIN_OPERATION, "--describe-module", "-d") {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    99
                void process(Main tool, String opt, String arg) throws BadArgs {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   100
                    if (tool.cflag || tool.iflag  || tool.tflag || tool.uflag || tool.xflag)
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   101
                        throw new BadArgs("error.multiple.main.operations").showUsage(true);
42463
39c0bbf9d03c 8170952: jar's usage message output need some cleanup
sherman
parents: 41489
diff changeset
   102
                    tool.dflag = true;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   103
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   104
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   105
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   106
            // Additional options
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   107
            new Option(true, OptionType.ANY, "--file", "-f") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   108
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   109
                    jartool.fname = arg;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   110
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   111
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   112
            new Option(false, OptionType.ANY, "--verbose", "-v") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   113
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   114
                    jartool.vflag = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   115
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   116
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   117
            new Option(false, OptionType.CREATE, "--normalize", "-n") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   118
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   119
                    jartool.nflag = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   120
                }
43805
9051877afb06 8165035: jar --help-extra should provide information on the -n/--normalize option
psandoz
parents: 43712
diff changeset
   121
                boolean isExtra() { return true; }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   122
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   123
            new Option(true, OptionType.CREATE_UPDATE, "--main-class", "-e") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   124
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   125
                    jartool.ename = arg;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   126
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   127
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   128
            new Option(true, OptionType.CREATE_UPDATE, "--manifest", "-m") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   129
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   130
                    jartool.mname = arg;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   131
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   132
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   133
            new Option(false, OptionType.CREATE_UPDATE, "--no-manifest", "-M") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   134
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   135
                    jartool.Mflag = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   136
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   137
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   138
            new Option(true, OptionType.CREATE_UPDATE, "--module-version") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   139
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   140
                    jartool.moduleVersion = Version.parse(arg);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   141
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   142
            },
37779
7c84df693837 8154956: Module system implementation refresh (4/2016)
alanb
parents: 36511
diff changeset
   143
            new Option(true, OptionType.CREATE_UPDATE, "--hash-modules") {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   144
                void process(Main jartool, String opt, String arg) throws BadArgs {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   145
                    try {
37779
7c84df693837 8154956: Module system implementation refresh (4/2016)
alanb
parents: 36511
diff changeset
   146
                        jartool.modulesToHash = Pattern.compile(arg);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   147
                    } catch (PatternSyntaxException e) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   148
                        throw new BadArgs("err.badpattern", arg).showUsage(true);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   149
                    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   150
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   151
            },
40261
86a49ba76f52 8136930: Simplify use of module-system options by custom launchers
mchung
parents: 37779
diff changeset
   152
            new Option(true, OptionType.CREATE_UPDATE, "--module-path", "-p") {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   153
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   154
                    String[] dirs = arg.split(File.pathSeparator);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   155
                    Path[] paths = new Path[dirs.length];
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   156
                    int i = 0;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   157
                    for (String dir : dirs) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   158
                        paths[i++] = Paths.get(dir);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   159
                    }
43712
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents: 43109
diff changeset
   160
                    jartool.moduleFinder = ModulePath.of(Runtime.version(), true, paths);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   161
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   162
            },
42703
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   163
            new Option(false, OptionType.CREATE_UPDATE, "--do-not-resolve-by-default") {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   164
                void process(Main jartool, String opt, String arg) {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   165
                    ModuleResolution mres = jartool.moduleResolution;
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   166
                    jartool.moduleResolution = mres.withDoNotResolveByDefault();
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   167
                }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   168
                boolean isExtra() { return true; }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   169
            },
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   170
            new Option(true, OptionType.CREATE_UPDATE, "--warn-if-resolved") {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   171
                void process(Main jartool, String opt, String arg) throws BadArgs {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   172
                    ModuleResolution mres = ModuleResolution.empty();
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   173
                    if (jartool.moduleResolution.doNotResolveByDefault()) {
42703
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   174
                        mres.withDoNotResolveByDefault();
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   175
                    }
42703
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   176
                    if (arg.equals("deprecated")) {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   177
                        jartool.moduleResolution = mres.withDeprecated();
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   178
                    } else if (arg.equals("deprecated-for-removal")) {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   179
                        jartool.moduleResolution = mres.withDeprecatedForRemoval();
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   180
                    } else if (arg.equals("incubating")) {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   181
                        jartool.moduleResolution = mres.withIncubating();
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   182
                    } else {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   183
                        throw new BadArgs("error.bad.reason", arg);
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   184
                    }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   185
                }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   186
                boolean isExtra() { return true; }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   187
            },
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   188
            new Option(false, OptionType.CREATE_UPDATE_INDEX, "--no-compress", "-0") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   189
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   190
                    jartool.flag0 = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   191
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   192
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   193
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   194
            // Hidden options
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   195
            new Option(false, OptionType.OTHER, "-P") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   196
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   197
                    jartool.pflag = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   198
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   199
                boolean isHidden() { return true; }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   200
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   201
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   202
            // Other options
48543
7067fe4e054e 8189102: All tools should support -?, -h and --help
goetz
parents: 47216
diff changeset
   203
            new Option(true, true, OptionType.OTHER, "--help", "-h", "-?") {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   204
                void process(Main jartool, String opt, String arg) throws BadArgs {
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   205
                    if (jartool.info == null) {
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   206
                        if (arg == null) {
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   207
                            jartool.info = GNUStyleOptions::printHelp;  //  Main.Info.HELP;
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   208
                            return;
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   209
                        }
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   210
                        if (!arg.equals("compat"))
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   211
                            throw new BadArgs("error.illegal.option", arg).showUsage(true);
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   212
                        // jartool.info = Main.Info.COMPAT_HELP;
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   213
                        jartool.info = GNUStyleOptions::printCompatHelp;
42703
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   214
                    }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   215
                }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   216
            },
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   217
            new Option(false, OptionType.OTHER, "--help-extra") {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   218
                void process(Main jartool, String opt, String arg) throws BadArgs {
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   219
                    jartool.info = GNUStyleOptions::printHelpExtra;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   220
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   221
            },
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   222
            new Option(false, OptionType.OTHER, "--version") {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   223
                void process(Main jartool, String opt, String arg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   224
                    if (jartool.info == null)
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   225
                        jartool.info = GNUStyleOptions::printVersion;
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   226
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   227
            }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   228
    };
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   229
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   230
    enum OptionType {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   231
        MAIN_OPERATION("main"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   232
        ANY("any"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   233
        CREATE("create"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   234
        CREATE_UPDATE("create.update"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   235
        CREATE_UPDATE_INDEX("create.update.index"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   236
        OTHER("other");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   237
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   238
        /** Resource lookup section prefix. */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   239
        final String name;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   240
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   241
        OptionType(String name) { this.name = name; }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   242
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   243
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   244
    static abstract class Option {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   245
        final boolean hasArg;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   246
        final boolean argIsOptional;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   247
        final String[] aliases;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   248
        final OptionType type;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   249
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   250
        Option(boolean hasArg, OptionType type, String... aliases) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   251
            this(hasArg, false, type, aliases);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   252
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   253
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   254
        Option(boolean hasArg, boolean argIsOptional, OptionType type, String... aliases) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   255
            this.hasArg = hasArg;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   256
            this.argIsOptional = argIsOptional;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   257
            this.type = type;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   258
            this.aliases = aliases;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   259
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   260
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   261
        boolean isHidden() { return false; }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   262
42703
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   263
        boolean isExtra() { return false; }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   264
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   265
        boolean matches(String opt) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   266
            for (String a : aliases) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   267
                if (a.equals(opt)) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   268
                    return true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   269
                } else if (opt.startsWith("--") && hasArg && opt.startsWith(a + "=")) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   270
                    return true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   271
                } else if (opt.startsWith("--help") && opt.startsWith(a + ":")) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   272
                    return true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   273
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   274
            }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   275
            return false;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   276
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   277
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   278
        abstract void process(Main jartool, String opt, String arg) throws BadArgs;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   279
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   280
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   281
    static int parseOptions(Main jartool, String[] args) throws BadArgs {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   282
        int count = 0;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   283
        if (args.length == 0) {
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   284
            jartool.info = GNUStyleOptions::printUsageTryHelp;  //  never be here
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   285
            return 0;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   286
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   287
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   288
        // process options
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   289
        for (; count < args.length; count++) {
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   290
            if (args[count].charAt(0) != '-' || args[count].equals("-C") ||
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   291
                args[count].equals("--release"))
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   292
                break;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   293
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   294
            String name = args[count];
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   295
            Option option = getOption(name);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   296
            String param = null;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   297
            if (option.hasArg) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   298
                if (name.startsWith("--help")) {  // "special" optional separator
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   299
                    if (name.indexOf(':') > 0) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   300
                        param = name.substring(name.indexOf(':') + 1, name.length());
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   301
                    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   302
                } else if (name.startsWith("--") && name.indexOf('=') > 0) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   303
                    param = name.substring(name.indexOf('=') + 1, name.length());
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   304
                } else if (count + 1 < args.length) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   305
                    param = args[++count];
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   306
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   307
                if (!option.argIsOptional &&
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   308
                    (param == null || param.isEmpty() || param.charAt(0) == '-')) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   309
                    throw new BadArgs("error.missing.arg", name).showUsage(true);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   310
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   311
            }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   312
            option.process(jartool, name, param);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   313
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   314
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   315
        return count;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   316
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   317
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   318
    private static Option getOption(String name) throws BadArgs {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   319
        for (Option o : recognizedOptions) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   320
            if (o.matches(name)) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   321
                return o;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   322
            }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   323
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   324
        throw new BadArgs("error.unrecognized.option", name).showUsage(true);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   325
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   326
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   327
    static void printHelpExtra(PrintWriter out) {
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   328
        printHelp0(out, true);
42703
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   329
    }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   330
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   331
    static void printHelp(PrintWriter out) {
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   332
        printHelp0(out, false);
42703
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   333
    }
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   334
43095
336dfda4ae89 8172432: jar cleanup/update for module and mrm jar
sherman
parents: 42703
diff changeset
   335
    private static void printHelp0(PrintWriter out, boolean printExtra) {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   336
        out.format("%s%n", Main.getMsg("main.help.preopt"));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   337
        for (OptionType type : OptionType.values()) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   338
            boolean typeHeadingWritten = false;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   339
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   340
            for (Option o : recognizedOptions) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   341
                if (!o.type.equals(type))
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   342
                    continue;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   343
                String name = o.aliases[0].substring(1); // there must always be at least one name
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   344
                name = name.charAt(0) == '-' ? name.substring(1) : name;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   345
                if (o.isHidden() || name.equals("h")) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   346
                    continue;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   347
                }
42703
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   348
                if (o.isExtra() && !printExtra) {
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   349
                    continue;
20c39ea4a507 8170987: Module system implementation refresh (12/2016)
alanb
parents: 42463
diff changeset
   350
                }
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   351
                if (!typeHeadingWritten) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   352
                    out.format("%n%s%n", Main.getMsg("main.help.opt." + type.name));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   353
                    typeHeadingWritten = true;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   354
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   355
                out.format("%s%n", Main.getMsg("main.help.opt." + type.name + "." + name));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   356
            }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   357
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   358
        out.format("%n%s%n%n", Main.getMsg("main.help.postopt"));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   359
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   360
41484
834b7539ada3 8164689: Retrofit jar, jlink, jmod as a ToolProvider
mchung
parents: 40261
diff changeset
   361
    static void printCompatHelp(PrintWriter out) {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   362
        out.format("%s%n", Main.getMsg("usage.compat"));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   363
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   364
42463
39c0bbf9d03c 8170952: jar's usage message output need some cleanup
sherman
parents: 41489
diff changeset
   365
    static void printUsageTryHelp(PrintWriter out) {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   366
        out.format("%s%n", Main.getMsg("main.usage.summary.try"));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   367
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   368
41484
834b7539ada3 8164689: Retrofit jar, jlink, jmod as a ToolProvider
mchung
parents: 40261
diff changeset
   369
    static void printVersion(PrintWriter out) {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   370
        out.format("%s %s%n", "jar", System.getProperty("java.version"));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   371
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   372
}