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

jshell crashes with UnsupportedOperationException: Should not get here.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 15, 16
    • Fix Version/s: 17
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b19

      Description

      Seems to be some edge case with autocompletion. I reset everything and imported only java.time.*. Note that there is a class java.time.Instant but it has no public constructor.

      This happens with JDK 15. It also happens in my development build of JDK 16, which is up-to-date within a week or so, and whose latest tag is jdk-16+16.

      | Welcome to JShell -- Version 15
      | For an introduction type: /help intro

      jshell> /set start /dev/null

      jshell> /reset
      | Resetting state.

      jshell> import java.time.*

      jshell> new Instant // <== hit <TAB> to do completion at this point
      InstantiationError( InstantiationException(

      iationE
      Exception in thread "main" java.lang.UnsupportedOperationException: Should not get here.
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionSignaturesTask.description(ConsoleIOContext.java:757)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:443)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$2.doComplete(ConsoleIOContext.java:153)
      at jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:4302)
      at jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl$1.apply(LineReaderImpl.java:3797)
      at jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:665)
      at jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:454)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:233)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.getInput(JShellTool.java:1254)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1190)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:991)
      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:
              jlahoda Jan Lahoda
              Reporter:
              smarks Stuart Marks
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: