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

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

    Details

    • Subcomponent:
    • Resolved In Build:
      b159
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  redestad Claes Redestad
                  Reporter:
                  dkononenko Denis Kononenko (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  12 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: