mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-10 02:18:46 +00:00
8176333: jdeps error message should include a proper MR jar file name
Reviewed-by: lancea
This commit is contained in:
parent
9617bfb0f6
commit
b93beff9b7
@ -524,7 +524,7 @@ class JdepsTask {
|
||||
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();
|
||||
|
||||
@ -34,7 +34,7 @@ package com.sun.tools.jdeps;
|
||||
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 @@ class MultiReleaseException extends RuntimeException {
|
||||
*
|
||||
* @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 @@ class MultiReleaseException extends RuntimeException {
|
||||
*
|
||||
* @return the detailed error message array
|
||||
*/
|
||||
public String[] getMsg() {
|
||||
return msg;
|
||||
public Object[] getParams() {
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ main.opt.m=\
|
||||
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.module.not.found=module not found: {0}
|
||||
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}
|
||||
|
||||
@ -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 @@ public class MultiReleaseJar {
|
||||
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 @@ public class MultiReleaseJar {
|
||||
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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user