--- old/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java 2017-10-03 12:06:22.000000000 -0700 +++ new/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java 2017-10-03 12:06:22.000000000 -0700 @@ -234,49 +234,6 @@ } }, - new Option(true, CommandOption.CHECK_MODULES) { - void process(JdepsTask task, String opt, String arg) throws BadArgs { - if (task.command != null) { - throw new BadArgs("err.command.set", task.command, opt); - } - Set mods = Set.of(arg.split(",")); - task.options.addmods.addAll(mods); - task.command = task.checkModuleDeps(mods); - } - }, - new Option(true, CommandOption.GENERATE_MODULE_INFO) { - void process(JdepsTask task, String opt, String arg) throws BadArgs { - if (task.command != null) { - throw new BadArgs("err.command.set", task.command, opt); - } - task.command = task.genModuleInfo(Paths.get(arg), false); - } - }, - new Option(true, CommandOption.GENERATE_OPEN_MODULE) { - void process(JdepsTask task, String opt, String arg) throws BadArgs { - if (task.command != null) { - throw new BadArgs("err.command.set", task.command, opt); - } - task.command = task.genModuleInfo(Paths.get(arg), true); - } - }, - new Option(false, CommandOption.LIST_DEPS) { - void process(JdepsTask task, String opt, String arg) throws BadArgs { - if (task.command != null) { - throw new BadArgs("err.command.set", task.command, opt); - } - task.command = task.listModuleDeps(false); - } - }, - new Option(false, CommandOption.LIST_REDUCED_DEPS) { - void process(JdepsTask task, String opt, String arg) throws BadArgs { - if (task.command != null) { - throw new BadArgs("err.command.set", task.command, opt); - } - task.command = task.listModuleDeps(true); - } - }, - // ---- paths option ---- new Option(true, "-cp", "-classpath", "--class-path") { void process(JdepsTask task, String opt, String arg) { @@ -312,15 +269,6 @@ task.options.addmods.addAll(mods); } }, - new Option(true, "-m", "--module") { - void process(JdepsTask task, String opt, String arg) throws BadArgs { - if (!task.options.rootModules.isEmpty()) { - throw new BadArgs("err.option.already.specified", opt); - } - task.options.rootModules.add(arg); - task.options.addmods.add(arg); - } - }, new Option(true, "--multi-release") { void process(JdepsTask task, String opt, String arg) throws BadArgs { if (arg.equalsIgnoreCase("base")) { @@ -338,6 +286,70 @@ } } }, + new Option(false, "-q", "-quiet") { + void process(JdepsTask task, String opt, String arg) { + task.options.nowarning = true; + } + }, + new Option(false, "-version", "--version") { + void process(JdepsTask task, String opt, String arg) { + task.options.version = true; + } + }, + + // ---- module-specific options ---- + + new Option(true, "-m", "--module") { + void process(JdepsTask task, String opt, String arg) throws BadArgs { + if (!task.options.rootModules.isEmpty()) { + throw new BadArgs("err.option.already.specified", opt); + } + task.options.rootModules.add(arg); + task.options.addmods.add(arg); + } + }, + new Option(true, CommandOption.GENERATE_MODULE_INFO) { + void process(JdepsTask task, String opt, String arg) throws BadArgs { + if (task.command != null) { + throw new BadArgs("err.command.set", task.command, opt); + } + task.command = task.genModuleInfo(Paths.get(arg), false); + } + }, + new Option(true, CommandOption.GENERATE_OPEN_MODULE) { + void process(JdepsTask task, String opt, String arg) throws BadArgs { + if (task.command != null) { + throw new BadArgs("err.command.set", task.command, opt); + } + task.command = task.genModuleInfo(Paths.get(arg), true); + } + }, + new Option(true, CommandOption.CHECK_MODULES) { + void process(JdepsTask task, String opt, String arg) throws BadArgs { + if (task.command != null) { + throw new BadArgs("err.command.set", task.command, opt); + } + Set mods = Set.of(arg.split(",")); + task.options.addmods.addAll(mods); + task.command = task.checkModuleDeps(mods); + } + }, + new Option(false, CommandOption.LIST_DEPS) { + void process(JdepsTask task, String opt, String arg) throws BadArgs { + if (task.command != null) { + throw new BadArgs("err.command.set", task.command, opt); + } + task.command = task.listModuleDeps(false); + } + }, + new Option(false, CommandOption.LIST_REDUCED_DEPS) { + void process(JdepsTask task, String opt, String arg) throws BadArgs { + if (task.command != null) { + throw new BadArgs("err.command.set", task.command, opt); + } + task.command = task.listModuleDeps(true); + } + }, // ---- Target filtering options ---- new Option(true, "-p", "-package", "--package") { @@ -424,17 +436,6 @@ } }, - new Option(false, "-q", "-quiet") { - void process(JdepsTask task, String opt, String arg) { - task.options.nowarning = true; - } - }, - - new Option(false, "-version", "--version") { - void process(JdepsTask task, String opt, String arg) { - task.options.version = true; - } - }, new HiddenOption(false, "-fullversion") { void process(JdepsTask task, String opt, String arg) { task.options.fullVersion = true; --- old/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties 2017-10-03 12:06:23.000000000 -0700 +++ new/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties 2017-10-03 12:06:23.000000000 -0700 @@ -86,10 +86,6 @@ \ --add-modules [,...]\n\ \ Adds modules to the root set for analysis -main.opt.m=\ -\ -m \n\ -\ --module Specify the root module for analysis - main.opt.R=\ \ -R -recursive Recursively traverse all run-time dependences.\n\ \ The -R option implies -filter:none. If -p,\n\ @@ -121,6 +117,11 @@ \ type, method parameter types, returned type,\n\ \ checked exception types etc. +main.opt.m=\n\ +\Module dependence analysis options:\n\ +\ -m \n\ +\ --module Specify the root module for analysis + main.opt.generate-module-info=\ \ --generate-module-info Generate module-info.java under the specified\n\ \ directory. The specified JAR files will be\n\ @@ -142,7 +143,6 @@ \ graph after transition reduction. It also\n\ \ identifies any unused qualified exports. - main.opt.dotoutput=\ \ -dotoutput \n\ \ --dot-output Destination directory for DOT file output @@ -157,15 +157,15 @@ \ WARNING: JDK internal APIs are inaccessible. main.opt.list-deps=\ -\ --list-deps Lists the dependences and use of JDK internal\n\ -\ APIs. +\ --list-deps Lists the module dependences and also the\n\ +\ package names of JDK internal APIs if referenced. main.opt.list-reduced-deps=\ \ --list-reduced-deps Same as --list-deps with not listing\n\ \ the implied reads edges from the module graph\n\ -\ If module M1 depends on M2 and M3,\n\ -\ M2 requires public on M3, then M1 reading M3 is\n\ -\ implied and removed from the module graph. +\ If module M1 reads M2, and M2 requires\n\ +\ transitive on M3, then M1 reading M3 is implied\n\ +\ and is not shown in the graph. main.opt.depth=\ \ -depth= Specify the depth of the transitive\n\