8188321: (jdeps) help message should say "requires transitive" rather than "requires public"
authormchung
Tue, 03 Oct 2017 19:27:07 -0700
changeset 47308 5f351a1131e0
parent 47307 6864969a78ad
child 47309 66774e1fc3a7
child 47588 6feee2a82b0b
8188321: (jdeps) help message should say "requires transitive" rather than "requires public" Reviewed-by: sundar
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java	Tue Oct 03 14:00:00 2017 -0700
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java	Tue Oct 03 19:27:07 2017 -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<String> 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<String> 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;
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties	Tue Oct 03 14:00:00 2017 -0700
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties	Tue Oct 03 19:27:07 2017 -0700
@@ -86,10 +86,6 @@
 \  --add-modules <module-name>[,<module-name>...]\n\
 \                                Adds modules to the root set for analysis
 
-main.opt.m=\
-\  -m <module-name>\n\
-\  --module <module-name>        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 <module-name>\n\
+\  --module <module-name>        Specify the root module for analysis
+
 main.opt.generate-module-info=\
 \  --generate-module-info <dir>  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 <dir>\n\
 \  --dot-output <dir>            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=<depth>                Specify the depth of the transitive\n\