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

JShell: crash on tab-complete with NPE.

XMLWordPrintable

    • b160
    • generic
    • generic
    • Verified

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

        ADDITIONAL OS VERSION INFORMATION :
         System Version: macOS 10.12 (16A320)
          Kernel Version: Darwin 16.0.0

        A DESCRIPTION OF THE PROBLEM :
        Open JShell and try import a class with tab completion. Jshell crashes with NPE

        $ ./jshell
        | Welcome to JShell -- Version 9-ea
        | For an introduction type: /help intro

        jshell> import Ke <Press Tab>


        $ ./jshell
        | Welcome to JShell -- Version 9-ea
        | For an introduction type: /help intro

        jshell> import KeyException in thread "main" java.lang.NullPointerException
        at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.computeSuggestions(SourceCodeAnalysisImpl.java:384)
        at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.completionSuggestionsImpl(SourceCodeAnalysisImpl.java:282)
        at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.completionSuggestions(SourceCodeAnalysisImpl.java:247)
        at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$3.complete(ConsoleIOContext.java:123)
        at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.complete(ConsoleReader.java:3326)
        at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2683)
        at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2278)
        at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:197)
        at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1107)
        at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:908)
        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.

              rfield Robert Field (Inactive)
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: