8160851: Remove old launcher module-related options

Reviewed-by: jjg, alanb
This commit is contained in:
Mandy Chung 2016-08-30 17:47:46 -07:00
parent 6bcba7521c
commit 8120ff3110
15 changed files with 40 additions and 186 deletions

View File

@ -1090,7 +1090,7 @@ public class Modules extends JCTree.Visitor {
Set<ModuleSymbol> requiresPublic = requiresPublicCache.get(msym);
if (requiresPublic == null) {
//the module graph may contain cycles involving automatic modules or -XaddReads edges
//the module graph may contain cycles involving automatic modules or --add-reads edges
requiresPublic = new HashSet<>();
Set<ModuleSymbol> seen = new HashSet<>();
@ -1192,7 +1192,7 @@ public class Modules extends JCTree.Visitor {
}
// Terminology comes from
// -XaddExports:module/package=target,...
// --add-exports module/package=target,...
// Compare to
// module module { exports package to target, ... }
String moduleName = em.group(1);
@ -1245,7 +1245,7 @@ public class Modules extends JCTree.Visitor {
}
// Terminology comes from
// -XaddReads:target-module=source-module,...
// --add-reads target-module=source-module,...
// Compare to
// module target-module { requires source-module; ... }
String targetName = rm.group(1);

View File

@ -810,7 +810,7 @@ public class Locations {
* SYSTEM_MODULES and MODULE_PATH.
*
* The Location can be specified to accept overriding classes from the
* {@code -Xpatch:<module>=<path> } parameter.
* {@code --patch-module <module>=<path> } parameter.
*/
private class ModuleLocationHandler extends LocationHandler implements Location {
protected final String name;

View File

@ -183,15 +183,15 @@ public enum Option {
SOURCE_PATH("--source-path -sourcepath", "opt.arg.path", "opt.sourcepath", STANDARD, FILEMANAGER),
MODULE_SOURCE_PATH("--module-source-path -modulesourcepath", "opt.arg.mspath", "opt.modulesourcepath", STANDARD, FILEMANAGER),
MODULE_SOURCE_PATH("--module-source-path", "opt.arg.mspath", "opt.modulesourcepath", STANDARD, FILEMANAGER),
MODULE_PATH("--module-path -p -modulepath -mp", "opt.arg.path", "opt.modulepath", STANDARD, FILEMANAGER),
MODULE_PATH("--module-path -p", "opt.arg.path", "opt.modulepath", STANDARD, FILEMANAGER),
UPGRADE_MODULE_PATH("--upgrade-module-path -upgrademodulepath", "opt.arg.path", "opt.upgrademodulepath", STANDARD, FILEMANAGER),
UPGRADE_MODULE_PATH("--upgrade-module-path", "opt.arg.path", "opt.upgrademodulepath", STANDARD, FILEMANAGER),
SYSTEM("--system -system", "opt.arg.jdk", "opt.system", STANDARD, FILEMANAGER),
SYSTEM("--system", "opt.arg.jdk", "opt.system", STANDARD, FILEMANAGER),
PATCH_MODULE("--patch-module -Xpatch:", "opt.arg.patch", "opt.patch", EXTENDED, FILEMANAGER) {
PATCH_MODULE("--patch-module", "opt.arg.patch", "opt.patch", EXTENDED, FILEMANAGER) {
// The deferred filemanager diagnostics mechanism assumes a single value per option,
// but --patch-module can be used multiple times, once per module. Therefore we compose
// a value for the option containing the last value specified for each module, and separate
@ -273,7 +273,7 @@ public enum Option {
PROCESSOR_PATH("--processor-path -processorpath", "opt.arg.path", "opt.processorpath", STANDARD, FILEMANAGER),
PROCESSOR_MODULE_PATH("--processor-module-path -processormodulepath", "opt.arg.path", "opt.processormodulepath", STANDARD, FILEMANAGER),
PROCESSOR_MODULE_PATH("--processor-module-path", "opt.arg.path", "opt.processormodulepath", STANDARD, FILEMANAGER),
PARAMETERS("-parameters","opt.parameters", STANDARD, BASIC),
@ -311,7 +311,7 @@ public enum Option {
}
},
RELEASE("--release -release", "opt.arg.release", "opt.release", STANDARD, BASIC) {
RELEASE("--release", "opt.arg.release", "opt.release", STANDARD, BASIC) {
@Override
protected void help(Log log) {
Iterable<PlatformProvider> providers =
@ -566,7 +566,7 @@ public enum Option {
}
},
ADD_EXPORTS("--add-exports -XaddExports:", "opt.arg.addExports", "opt.addExports", EXTENDED, BASIC) {
ADD_EXPORTS("--add-exports", "opt.arg.addExports", "opt.addExports", EXTENDED, BASIC) {
@Override
public boolean process(OptionHelper helper, String option, String arg) {
String prev = helper.get(ADD_EXPORTS);
@ -575,7 +575,7 @@ public enum Option {
}
},
ADD_READS("--add-reads -XaddReads:", "opt.arg.addReads", "opt.addReads", EXTENDED, BASIC) {
ADD_READS("--add-reads", "opt.arg.addReads", "opt.addReads", EXTENDED, BASIC) {
@Override
public boolean process(OptionHelper helper, String option, String arg) {
String prev = helper.get(ADD_READS);
@ -598,9 +598,9 @@ public enum Option {
MODULE("--module -m", "opt.arg.m", "opt.m", STANDARD, BASIC),
ADD_MODULES("--add-modules -addmods", "opt.arg.addmods", "opt.addmods", STANDARD, BASIC),
ADD_MODULES("--add-modules", "opt.arg.addmods", "opt.addmods", STANDARD, BASIC),
LIMIT_MODULES("--limit-modules -limitmods", "opt.arg.limitmods", "opt.limitmods", STANDARD, BASIC),
LIMIT_MODULES("--limit-modules", "opt.arg.limitmods", "opt.limitmods", STANDARD, BASIC),
// This option exists only for the purpose of documenting itself.
// It's actually implemented by the CommandLine class.
@ -645,7 +645,7 @@ public enum Option {
}
},
MULTIRELEASE("--multi-release -multi-release", "opt.arg.multi-release", "opt.multi-release", HIDDEN, FILEMANAGER),
MULTIRELEASE("--multi-release", "opt.arg.multi-release", "opt.multi-release", HIDDEN, FILEMANAGER),
INHERIT_RUNTIME_ENVIRONMENT("--inherit-runtime-environment", "opt.inherit_runtime_environment",
EXTENDED, BASIC) {

View File

@ -36,7 +36,7 @@ import javax.annotation.processing.Processor;
import com.sun.source.util.Plugin;
/**A description of settings needed for a particular {@code -release name} option.
/**A description of settings needed for a particular {@code --release name} option.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.

View File

@ -25,7 +25,7 @@
package com.sun.tools.javac.platform;
/** A collection of platform descriptions that can be selected using {@code -release name}
/** A collection of platform descriptions that can be selected using {@code --release name}
* command line option.
* Register in {@code META-INF/services/com.sun.tools.javac.platform.PlatformProvider}.
*
@ -36,7 +36,7 @@ package com.sun.tools.javac.platform;
*/
public interface PlatformProvider {
/**Names of platforms supported by this provider. Each returned name can be used as the key for -release.
/**Names of platforms supported by this provider. Each returned name can be used as the key for --release.
*
* @return the platform keys
*/

View File

@ -24,7 +24,7 @@
*/
/**
* An internal API for plugging in -release implementations.
* An internal API for plugging in --release implementations.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.

View File

@ -2780,10 +2780,10 @@ compiler.err.module-info.with.xmodule.classpath=\
illegal combination of -Xmodule and module-info on classpath
compiler.err.xmodule.no.module.sourcepath=\
illegal combination of -Xmodule and -modulesourcepath
illegal combination of -Xmodule and --module-source-path
compiler.err.processorpath.no.processormodulepath=\
illegal combination of -processorpath and -processormodulepath
illegal combination of -processorpath and --processor-module-path
# 0: symbol
compiler.err.package.in.other.module=\
@ -2817,22 +2817,22 @@ compiler.err.duplicate.module.on.path=\
# 0: string
compiler.err.xaddexports.malformed.entry=\
bad value for -XaddExports: {0}
bad value for --add-exports {0}
# 0: string
compiler.err.xaddexports.too.many=\
multiple -XaddExports options for {0}
multiple --add-exports options for {0}
# 0: string
compiler.err.xaddreads.malformed.entry=\
bad value for -XaddReads: {0}
bad value for --add-reads {0}
# 0: string
compiler.err.xaddreads.too.many=\
multiple -XaddReads options for {0}
multiple --add-reads options for {0}
compiler.err.addmods.all.module.path.invalid=\
-addmods ALL-MODULE-PATH can only be used when compiling the unnamed module
--add-modules ALL-MODULE-PATH can only be used when compiling the unnamed module
compiler.misc.locn.module_source_path=\
module source path

View File

@ -390,10 +390,10 @@ javac.version={0} {1}
javac.fullVersion={0} full version "{1}"
javac.err.release.bootclasspath.conflict=\
option {0} cannot be used together with -release
option {0} cannot be used together with --release
javac.err.unsupported.release.version=\
release version {0} not supported
javac.err.release.not.standard.file.manager=\
-release option specified, but the provided JavaFileManager is not a StandardJavaFileManager.
--release option specified, but the provided JavaFileManager is not a StandardJavaFileManager.

View File

@ -85,13 +85,7 @@ public enum Option {
helper.modulepath(paths);
}
},
MODULEPATH("-modulepath", "An alias for -modulepath") {
@Override
protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
MODULE_PATH.processMatching(iter, helper);
}
},
P("-p", "An alias for -modulepath") {
P("-p", "An alias for --module-path") {
@Override
protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
MODULE_PATH.processMatching(iter, helper);

View File

@ -104,13 +104,6 @@ public enum ToolOption {
}
},
MODULESOURCEPATH("-modulesourcepath", true) {
@Override
public void process(Helper helper, String arg) {
helper.setFileManagerOpt(Option.MODULE_SOURCE_PATH, arg);
}
},
MODULE_SOURCE_PATH("--module-source-path", true) {
@Override
public void process(Helper helper, String arg) {
@ -118,13 +111,6 @@ public enum ToolOption {
}
},
UPGRADEMODULEPATH("-upgrademodulepath", true) {
@Override
public void process(Helper helper, String arg) {
helper.setFileManagerOpt(Option.UPGRADE_MODULE_PATH, arg);
}
},
UPGRADE_MODULE_PATH("--upgrade-module-path", true) {
@Override
public void process(Helper helper, String arg) {
@ -132,13 +118,6 @@ public enum ToolOption {
}
},
SYSTEM("-system", true) {
@Override
public void process(Helper helper, String arg) {
helper.setFileManagerOpt(Option.SYSTEM, arg);
}
},
SYSTEM_("--system", true) {
@Override
public void process(Helper helper, String arg) {
@ -146,13 +125,6 @@ public enum ToolOption {
}
},
MODULEPATH("-modulepath", true) {
@Override
public void process(Helper helper, String arg) {
helper.setFileManagerOpt(Option.MODULE_PATH, arg);
}
},
MODULE_PATH("--module-path", true) {
@Override
public void process(Helper helper, String arg) {
@ -167,13 +139,6 @@ public enum ToolOption {
}
},
ADDMODS("-addmods", true) {
@Override
public void process(Helper helper, String arg) {
helper.setCompilerOpt(opt, arg);
}
},
ADD_MODULES("--add-modules", true) {
@Override
public void process(Helper helper, String arg) {
@ -181,13 +146,6 @@ public enum ToolOption {
}
},
LIMITMODS("-limitmods", true) {
@Override
public void process(Helper helper, String arg) {
helper.setCompilerOpt(opt, arg);
}
},
LIMIT_MODULES("--limit-modules", true) {
@Override
public void process(Helper helper, String arg) {
@ -210,13 +168,6 @@ public enum ToolOption {
}
},
RELEASE_OLD("-release", true) {
@Override
public void process(Helper helper, String arg) {
helper.setCompilerOpt("--release", arg);
}
},
SOURCE("-source", true) {
@Override
public void process(Helper helper, String arg) {
@ -238,13 +189,6 @@ public enum ToolOption {
}
},
XADDREADS("-XaddReads:", false) {
@Override
public void process(Helper helper, String arg) {
Option.ADD_READS.process(helper.getOptionHelper(), arg);
}
},
ADD_READS("--add-reads", true) {
@Override
public void process(Helper helper, String arg) {
@ -252,13 +196,6 @@ public enum ToolOption {
}
},
ADDEXPORTS("-XaddExports:", false) {
@Override
public void process(Helper helper, String arg) {
Option.ADD_EXPORTS.process(helper.getOptionHelper(), arg);
}
},
ADD_EXPORTS("--add-exports", true) {
@Override
public void process(Helper helper, String arg) {
@ -273,13 +210,6 @@ public enum ToolOption {
}
},
XPATCH("-Xpatch:", false) {
@Override
public void process(Helper helper, String arg) {
Option.XMODULE.process(helper.getOptionHelper(), arg);
}
},
PATCH_MODULE("--patch-module", true) {
@Override
public void process(Helper helper, String arg) {

View File

@ -106,13 +106,6 @@ public enum ToolOption {
}
},
MODULESOURCEPATH("-modulesourcepath", true) {
@Override
public void process(Helper helper, String arg) {
helper.setFileManagerOpt(Option.MODULE_SOURCE_PATH, arg);
}
},
MODULE_SOURCE_PATH("--module-source-path", true) {
@Override
public void process(Helper helper, String arg) {
@ -120,13 +113,6 @@ public enum ToolOption {
}
},
UPGRADEMODULEPATH("-upgrademodulepath", true) {
@Override
public void process(Helper helper, String arg) {
helper.setFileManagerOpt(Option.UPGRADE_MODULE_PATH, arg);
}
},
UPGRADE_MODULE_PATH("--upgrade-module-path", true) {
@Override
public void process(Helper helper, String arg) {
@ -134,27 +120,13 @@ public enum ToolOption {
}
},
SYSTEM("-system", true) {
SYSTEM("--system", true) {
@Override
public void process(Helper helper, String arg) {
helper.setFileManagerOpt(Option.SYSTEM, arg);
}
},
SYSTEM_("--system", true) {
@Override
public void process(Helper helper, String arg) {
helper.setFileManagerOpt(Option.SYSTEM, arg);
}
},
MODULEPATH("-modulepath", true) {
@Override
public void process(Helper helper, String arg) {
helper.setFileManagerOpt(Option.MODULE_PATH, arg);
}
},
MODULE_PATH("--module-path", true) {
@Override
public void process(Helper helper, String arg) {
@ -169,13 +141,6 @@ public enum ToolOption {
}
},
ADDMODS("-addmods", true) {
@Override
public void process(Helper helper, String arg) {
Option.ADD_MODULES.process(helper.getOptionHelper(), opt, arg);
}
},
ADD_MODULES("--add-modules", true) {
@Override
public void process(Helper helper, String arg) {
@ -183,13 +148,6 @@ public enum ToolOption {
}
},
LIMITMODS("-limitmods", true) {
@Override
public void process(Helper helper, String arg) {
Option.LIMIT_MODULES.process(helper.getOptionHelper(), opt, arg);
}
},
LIMIT_MODULES("--limit-modules", true) {
@Override
public void process(Helper helper, String arg) {
@ -218,13 +176,6 @@ public enum ToolOption {
}
},
RELEASE_OLD("-release", true) {
@Override
public void process(Helper helper, String arg) {
Option.RELEASE.process(helper.getOptionHelper(), opt, arg);
}
},
SOURCE("-source", true) {
@Override
public void process(Helper helper, String arg) {
@ -246,13 +197,6 @@ public enum ToolOption {
}
},
XADDREADS("-XaddReads:", false) {
@Override
public void process(Helper helper, String arg) {
Option.ADD_READS.process(helper.getOptionHelper(), arg);
}
},
ADD_READS("--add-reads", true) {
@Override
public void process(Helper helper, String arg) {
@ -260,13 +204,6 @@ public enum ToolOption {
}
},
ADDEXPORTS("-XaddExports:", false) {
@Override
public void process(Helper helper, String arg) {
Option.ADD_EXPORTS.process(helper.getOptionHelper(), arg);
}
},
ADD_EXPORTS("--add-exports", true) {
@Override
public void process(Helper helper, String arg) {
@ -281,13 +218,6 @@ public enum ToolOption {
}
},
XPATCH("-Xpatch:", false) {
@Override
public void process(Helper helper, String arg) {
Option.XMODULE.process(helper.getOptionHelper(), arg);
}
},
PATCH_MODULE("--patch-module", true) {
@Override
public void process(Helper helper, String arg) {

View File

@ -81,7 +81,7 @@ import javax.lang.model.element.TypeElement;
* - more rigorous GNU style option parsing; use joptsimple?
*
* FUTURES:
* - add module support: -addmods, -modulepath, module arg
* - add module support: --add-modules, --module-path, module arg
* - load deprecation declarations from a designated class library instead
* of the JDK
* - load deprecation declarations from a module
@ -331,7 +331,7 @@ public class Main implements DiagnosticListener<JavaFileObject> {
* @throws IOException if an I/O error occurs
*/
boolean processSelf(Collection<String> classes) throws IOException {
options.add("-addmods");
options.add("--add-modules");
options.add("java.se.ee,jdk.xml.bind"); // TODO why jdk.xml.bind?
if (classes.isEmpty()) {
@ -360,7 +360,7 @@ public class Main implements DiagnosticListener<JavaFileObject> {
* @return success value
*/
boolean processRelease(String release, Collection<String> classes) throws IOException {
options.addAll(List.of("-release", release));
options.addAll(List.of("--release", release));
if (release.equals("9")) {
List<String> rootMods = List.of("java.se", "java.se.ee");
@ -368,7 +368,7 @@ public class Main implements DiagnosticListener<JavaFileObject> {
JavaCompiler.CompilationTask task =
compiler.getTask(null, fm, this,
// options
List.of("-addmods", String.join(",", rootMods)),
List.of("--add-modules", String.join(",", rootMods)),
// classes
List.of("java.lang.Object"),
null);
@ -377,7 +377,7 @@ public class Main implements DiagnosticListener<JavaFileObject> {
return false;
}
Map<PackageElement, List<TypeElement>> types = proc.getPublicTypes();
options.add("-addmods");
options.add("--add-modules");
options.add(String.join(",", rootMods));
return doClassNames(
types.values().stream()

View File

@ -56,7 +56,7 @@ import static java.util.stream.Collectors.*;
* 1. archives specified in the command line arguments
* 2. observable modules matching the source filter
* 3. classpath archives matching the source filter or target filter
* 4. -addmods and -m root modules
* 4. --add-modules and -m root modules
*/
public class DepsAnalyzer {
final JdepsConfiguration configuration;

View File

@ -127,7 +127,7 @@ public class JdepsConfiguration implements AutoCloseable {
}
}
// all roots specified in -addmods or -m are included
// all roots specified in --add-modules or -m are included
// as the initial set for analysis.
roots.stream()
.map(nameToModule::get)
@ -342,7 +342,7 @@ public class JdepsConfiguration implements AutoCloseable {
SystemModuleFinder(String javaHome) throws IOException {
if (javaHome == null) {
// -system none
// --system none
this.fileSystem = null;
this.root = null;
this.systemModules = Collections.emptyMap();

View File

@ -313,7 +313,7 @@ class JdepsTask {
}
},
// Another alternative to list modules in -addmods option
// Another alternative to list modules in --add-modules option
new HiddenOption(true, "--include-system-modules") {
void process(JdepsTask task, String opt, String arg) throws BadArgs {
task.options.includeSystemModulePattern = Pattern.compile(arg);