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

Jshell crashing on autocompletion

    XMLWordPrintable

Details

    • b164
    • 9
    • b22
    • generic
    • generic
    • Verified

    Description

      FULL PRODUCT VERSION :
      java version "9"
      Java(TM) SE Runtime Environment (build 9+179)
      Java HotSpot(TM) 64-Bit Server VM (build 9+179, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.3.9600]

      A DESCRIPTION OF THE PROBLEM :
      Jshell crashing on autocompletion when tab is pressed more than 3 times

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Open jshell and press tab key 4 times

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Autocompletion in console

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
              at java.base/java.lang.String.substring(String.java:1852)
              at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$AllSuggestionsCompletionTask.lambda$perform$1(ConsoleIOContext.java:524)
              at java.base/java.util.Optional.map(Optional.java:257)
              at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$AllSuggestionsCompletionTask.perform(ConsoleIOContext.java:524)
              at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:287)
              at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.access$000(ConsoleIOContext.java:69)
              at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$1.complete(ConsoleIOContext.java:100)
              at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2684)
              at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2279)
              at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:139)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1140)
              at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:929)
              at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.run(JShellToolBuilder.java:239)
              at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:119)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      Attachments

        Issue Links

          Activity

            People

              jlahoda Jan Lahoda
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: