8169713: jimage fails with StringIndexOutOfBoundsException when path to the inspected image is an empty string
authorredestad
Thu, 23 Feb 2017 18:37:51 +0100
changeset 43987 068a2419b5a7
parent 43986 717c0cbb60fd
child 43989 f122846f6beb
8169713: jimage fails with StringIndexOutOfBoundsException when path to the inspected image is an empty string Reviewed-by: jlaskey
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Wed Feb 22 14:12:01 2017 -0800
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java	Thu Feb 23 18:37:51 2017 +0100
@@ -524,7 +524,7 @@
             List<String> rest = collectUnhandled? new ArrayList<>() : null;
             // process options
             for (int i = 0; i < args.length; i++) {
-                if (args[i].charAt(0) == '-') {
+                if (args[i].startsWith("-")) {
                     String name = args[i];
                     PluginOption pluginOption = null;
                     Option<T> option = getOption(name);