changeset 57921:4f9dc5bee9c4

8219475: javap man page needs to be updated Reviewed-by: mchung
author jjg
date Tue, 04 Feb 2020 14:02:16 -0800
parents ca6c676cab64
children 84e55cb3894e
files src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties
diffstat 2 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java	Tue Feb 04 13:15:15 2020 -0800
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java	Tue Feb 04 14:02:16 2020 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -326,6 +326,20 @@
             void process(JavapTask task, String opt, String arg) throws BadArgs {
                 task.options.moduleName = arg;
             }
+        },
+
+        // this option is processed by the launcher, and cannot be used when invoked via
+        // an API like ToolProvider. It exists here to be documented in the command-line help.
+        new Option(false, "-J") {
+            @Override
+            boolean matches(String opt) {
+                return opt.startsWith("-J");
+            }
+
+            @Override
+            void process(JavapTask task, String opt, String arg) throws BadArgs {
+                throw task.new BadArgs("err.only.for.launcher");
+            }
         }
 
     };
@@ -936,7 +950,7 @@
         printLines(getMessage("main.usage", progname));
         for (Option o: recognizedOptions) {
             String name = o.aliases[0].replaceAll("^-+", "").replaceAll("-+", "_"); // there must always be at least one name
-            if (name.startsWith("X") || name.equals("fullversion") || name.equals("h") || name.equals("verify"))
+            if (name.startsWith("X") || name.equals("fullversion"))
                 continue;
             printLines(getMessage("main.opt." + name));
         }
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties	Tue Feb 04 13:15:15 2020 -0800
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap.properties	Tue Feb 04 14:02:16 2020 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
 err.nomem=Insufficient memory. To increase memory use -J-Xmx option.
 err.cant.find.module=Cannot find module {0}
 err.cant.find.module.ex=Problem finding module {0}: {1}
+err.only.for.launcher=This option can only be used when invoking javap from the command-line launcher.
 
 main.usage.summary=\
 Usage: {0} <options> <classes>\n\
@@ -55,17 +56,13 @@
 
 note.prefix=Note:
 
-main.usage.summary=\
-Usage: {0} <options> <classes>\n\
-use --help for a list of possible options
-
 main.usage=\
 Usage: {0} <options> <classes>\n\
 where possible options include:
 
 
 main.opt.help=\
-\  -? -h --help -help               Print this help message
+\  --help -help -h -?               Print this help message
 
 main.opt.version=\
 \  -version                         Version information
@@ -129,6 +126,9 @@
 main.opt.module=\
 \  --module <module>, -m <module>   Specify module containing classes to be disassembled
 
+main.opt.J=\
+\  -J<vm-option>                    Specify a VM option
+
 main.usage.foot=\n\
 GNU-style options may use '=' instead of whitespace to separate the name of an option\n\
 from its value.\n\