Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8169713

jimage fails with StringIndexOutOfBoundsException when path to the inspected image is an empty string

XMLWordPrintable

    • b159
    • generic
    • generic
    • Not verified

        The following command causes a failure:

        % jimage list ''

        java.lang.StringIndexOutOfBoundsException: String index out of range: 0
                at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:45)
                at java.base/java.lang.String.charAt(String.java:704)
                at jdk.jlink/jdk.tools.jlink.internal.TaskHelper$OptionsHelper.handleOptions(TaskHelper.java:530)
                at jdk.jlink/jdk.tools.jlink.internal.TaskHelper$OptionsHelper.handleOptions(TaskHelper.java:482)
                at jdk.jlink/jdk.tools.jimage.JImageTask.run(JImageTask.java:174)
                at jdk.jlink/jdk.tools.jimage.Main.main(Main.java:34)


        If the last argument is omitted the correct message appears:
        % jimage list
        Error: no jimage provided

        The issue affects all jimage commands: info, list, extract, verify.

        Tested on the latest jigsaw and jdk 9-ea+144.

              redestad Claes Redestad
              dkononenko Denis Kononenko
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: