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

JShell fails and exits when statement throws an exception whose message contains a '%'.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 12
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b17
    • Verification:
      Verified

      Description

      The following statement will throw an URISyntaxException whose message
      contains a '%'. JShell fails to display the exception and exits instead.

      jshell> URI u = new URI("http", null, "h", -1, "a" + (char)0x04, null, null);

      Exception in thread "main" java.util.IllegalFormatFlagsException: Flags = '0'
              at java.base/java.util.Formatter$FormatSpecifier.checkText(Formatter.java:3191)
              at java.base/java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2878)
              at java.base/java.util.Formatter.parse(Formatter.java:2713)
              at java.base/java.util.Formatter.format(Formatter.java:2655)
              at java.base/java.io.PrintStream.format(PrintStream.java:1053)
              at java.base/java.io.PrintStream.printf(PrintStream.java:949)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.error(JShellTool.java:728)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.errormsg(JShellTool.java:867)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.displayEvalException(JShellTool.java:3451)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.displayException(JShellTool.java:3425)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.displayException(JShellTool.java:3418)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.handleEvent(JShellTool.java:3582)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSource(JShellTool.java:3550)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSourceCatchingReset(JShellTool.java:1301)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processInput(JShellTool.java:1203)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1176)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:975)
              at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:254)
              at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:120)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rfield Robert Field
                Reporter:
                dfuchs Daniel Fuchs
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: