8176333: jdeps error message should include a proper MR jar file name
authormchung
Tue, 07 Mar 2017 18:57:19 -0800
changeset 44182 ce2f0cbc81b9
parent 44181 2075fecdcce1
child 44183 17244500b154
8176333: jdeps error message should include a proper MR jar file name Reviewed-by: lancea
langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java
langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java
langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
langtools/test/tools/jdeps/MultiReleaseJar.java
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java	Tue Mar 07 18:37:17 2017 -0800
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java	Tue Mar 07 18:57:19 2017 -0800
@@ -524,7 +524,7 @@
             e.printStackTrace();
             return EXIT_CMDERR;
         } catch (MultiReleaseException e) {
-            reportError(e.getKey(), (Object)e.getMsg());
+            reportError(e.getKey(), e.getParams());
             return EXIT_CMDERR;  // could be EXIT_ABNORMAL sometimes
         } finally {
             log.flush();
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java	Tue Mar 07 18:37:17 2017 -0800
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java	Tue Mar 07 18:57:19 2017 -0800
@@ -34,7 +34,7 @@
 class MultiReleaseException extends RuntimeException {
     private static final long serialVersionUID = 4474870142461654108L;
     private final String key;
-    private final String[] msg;
+    private final Object[] params;
 
     /**
      * Constructs an {@code MultiReleaseException} with the specified detail
@@ -42,13 +42,13 @@
      *
      * @param key
      *        The key that identifies the message in the jdeps.properties file
-     * @param msg
+     * @param params
      *        The detail message array
      */
-    public MultiReleaseException(String key, String... msg) {
+    public MultiReleaseException(String key, Object... params) {
         super();
         this.key = key;
-        this.msg = msg;
+        this.params = params;
     }
 
     /**
@@ -63,7 +63,7 @@
      *
      * @return the detailed error message array
      */
-    public String[] getMsg() {
-        return msg;
+    public Object[] getParams() {
+        return params;
     }
 }
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties	Tue Mar 07 18:37:17 2017 -0800
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties	Tue Mar 07 18:57:19 2017 -0800
@@ -93,7 +93,7 @@
 main.opt.R=\
 \  -R       -recursive           Recursively traverse all run-time dependences.\n\
 \                                The -R option implies -filter:none.  If -p,\n\
-\                                -e, -foption is specified, only the matching\n\
+\                                -e, -f option is specified, only the matching\n\
 \                                dependences are analyzed.
 
 main.opt.I=\
@@ -196,8 +196,8 @@
 err.root.module.not.set=root module set empty
 err.option.already.specified={0} option specified more than once.
 err.filter.not.specified=--package (-p), --regex (-e), --require option must be specified
-err.multirelease.option.exists={0} is not a multi-release jar file, but the --multi-release option is set
-err.multirelease.option.notfound={0} is a multi-release jar file, but the --multi-release option is not set
+err.multirelease.option.exists={0} is not a multi-release jar file but --multi-release option is set
+err.multirelease.option.notfound={0} is a multi-release jar file but --multi-release option is not set
 err.multirelease.version.associated=class {0} already associated with version {1}, trying to add version {2}
 err.multirelease.jar.malformed=malformed multi-release jar, {0}, bad entry: {1}
 warn.invalid.arg=Path does not exist: {0}
--- a/langtools/test/tools/jdeps/MultiReleaseJar.java	Tue Mar 07 18:37:17 2017 -0800
+++ b/langtools/test/tools/jdeps/MultiReleaseJar.java	Tue Mar 07 18:57:19 2017 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8153654
+ * @bug 8153654 8176333
  * @summary Tests for jdeps tool with multi-release jar files
  * @modules jdk.jdeps/com.sun.tools.jdeps
  * @library mrjar mrjar/base mrjar/9 mrjar/10 mrjar/v9 mrjar/v10
@@ -67,7 +67,7 @@
         checkResult(r, false, "Warning: Path does not exist: missing.jar");
 
         r = run("jdeps -v Version.jar");
-        checkResult(r, false, "the --multi-release option is not set");
+        checkResult(r, false, "--multi-release option is not set");
 
         r = run("jdeps --multi-release base  -v Version.jar");
         checkResult(r, true,
@@ -105,7 +105,7 @@
         checkResult(r, false, "Error: invalid argument for option: 9.1");
 
         r = run("jdeps -v -R -cp Version.jar test/Main.class");
-        checkResult(r, false, "the --multi-release option is not set");
+        checkResult(r, false, "--multi-release option is not set");
 
         r = run("jdeps -v -R -cp Version.jar -multi-release 9 test/Main.class");
         checkResult(r, false,