8170120: jimage throws IOException when the given file is not a jimage file
Reviewed-by: alanb
This commit is contained in:
parent
c2859d192d
commit
04b8b8deff
@ -386,7 +386,7 @@ class JImageTask {
|
||||
|
||||
for (File file : options.jimages) {
|
||||
if (!file.exists() || !file.isFile()) {
|
||||
throw TASK_HELPER.newBadArgs("err.not.a.jimage", file.getName());
|
||||
throw TASK_HELPER.newBadArgs("err.not.a.jimage", file);
|
||||
}
|
||||
|
||||
try (BasicImageReader reader = BasicImageReader.open(file.toPath())) {
|
||||
@ -431,6 +431,8 @@ class JImageTask {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
throw TASK_HELPER.newBadArgs("err.invalid.jimage", file, ioe.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,6 +95,7 @@ err.not.a.task=task must be one of <extract | info | list | verify>: {0}
|
||||
err.missing.arg=no value given for {0}
|
||||
err.not.a.dir=not a directory: {0}
|
||||
err.not.a.jimage=not a jimage file: {0}
|
||||
err.invalid.jimage=Unable to open {0}: {1}
|
||||
err.no.jimage=no jimage provided
|
||||
err.option.unsupported={0} not supported: {1}
|
||||
err.unknown.option=unknown option: {0}
|
||||
|
@ -466,7 +466,6 @@ tools/launcher/FXLauncherTest.java 8068049 linux-al
|
||||
|
||||
tools/jimage/JImageExtractTest.java 8170120 generic-all
|
||||
tools/jimage/JImageListTest.java 8170120 generic-all
|
||||
tools/jimage/JImageVerifyTest.java 8170120 generic-all
|
||||
|
||||
############################################################################
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user