From yamadamn at gmail.com Mon Apr 1 14:37:29 2019 From: yamadamn at gmail.com (Takahiro YAMADA) Date: Mon, 1 Apr 2019 23:37:29 +0900 Subject: To complete java.io.File.path with Tab key causes UnsupportedOperationException In-Reply-To: References: Message-ID: Hi, Could someone address this issue? It is easily reproducible. On Tue, Mar 26, 2019 at 11:49 PM Takahiro YAMADA wrote: > Hi kulla-dev, > > When I try to complete "java.io.File.path" with Tab key, below exception > occurs. > > ******** > bash-4.2# jshell > | Welcome to JShell -- Version 12 > | For an introduction type: /help intro > > jshell> java.io.File.path > pathSeparator pathSeparatorChar > > Separator > Exception in thread "main" java.lang.UnsupportedOperationException: Should > not get here. > at > jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionSignaturesTask.description(ConsoleIOContext.java:720) > at > jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:406) > at > jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$1.doComplete(ConsoleIOContext.java:142) > at > jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:3875) > at > jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:585) > at > jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:404) > at > jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:201) > at > jdk.jshell/jdk.internal.jshell.tool.JShellTool.getInput(JShellTool.java:1238) > at > jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1174) > 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) > bash-4.2# > ******** > > And JShell has stopped forcefully. > Could you file and solve this issue? > > Environment: > - Windows/macOS/Linux. > - JDK 11~13-ea+13 > > -- > Takahiro YAMADA > From jan.lahoda at oracle.com Mon Apr 1 14:55:25 2019 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 1 Apr 2019 16:55:25 +0200 Subject: To complete java.io.File.path with Tab key causes UnsupportedOperationException In-Reply-To: References: Message-ID: <5CA2265D.6070002@oracle.com> Thanks for the report, I've filled: https://bugs.openjdk.java.net/browse/JDK-8221759 Jan On 1.4.2019 16:37, Takahiro YAMADA wrote: > Hi, > > Could someone address this issue? > It is easily reproducible. > > On Tue, Mar 26, 2019 at 11:49 PM Takahiro YAMADA wrote: > >> Hi kulla-dev, >> >> When I try to complete "java.io.File.path" with Tab key, below exception >> occurs. >> >> ******** >> bash-4.2# jshell >> | Welcome to JShell -- Version 12 >> | For an introduction type: /help intro >> >> jshell> java.io.File.path >> pathSeparator pathSeparatorChar >> >> Separator >> Exception in thread "main" java.lang.UnsupportedOperationException: Should >> not get here. >> at >> jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionSignaturesTask.description(ConsoleIOContext.java:720) >> at >> jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:406) >> at >> jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$1.doComplete(ConsoleIOContext.java:142) >> at >> jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:3875) >> at >> jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:585) >> at >> jdk.internal.le/jdk.internal.org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:404) >> at >> jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:201) >> at >> jdk.jshell/jdk.internal.jshell.tool.JShellTool.getInput(JShellTool.java:1238) >> at >> jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1174) >> 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) >> bash-4.2# >> ******** >> >> And JShell has stopped forcefully. >> Could you file and solve this issue? >> >> Environment: >> - Windows/macOS/Linux. >> - JDK 11~13-ea+13 >> >> -- >> Takahiro YAMADA >> From jan.lahoda at oracle.com Mon Apr 15 11:32:43 2019 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 15 Apr 2019 13:32:43 +0200 Subject: RFR: JDK-8221759: Crash when completing "java.io.File.path" Message-ID: <1a06ddad-b131-77ae-a6b3-61b5afe02058@oracle.com> Hi, Typing: java.io.File.path and pressing leads to a crash/exception. The root reason appears to be that in addition to the expected completions (i.e. 'pathSeparator' and 'pathSeparatorChar'), there is also a private field of File, called "path". That is not accessible, so it is not shown as a completion, but the "SourceCodeAnalysis.documentation" call includes documentation for it, which ultimately leads to the crash. The proposed fix is to include the accessibility check also in the "SourceCodeAnalysis.documentation" call, so that inaccessible elements are ignored for documentation as they are for completion. Webrev: http://cr.openjdk.java.net/~jlahoda/8221759/webrev.00/ JBS: https://bugs.openjdk.java.net/browse/JDK-8221759 How does this look? Thanks, Jan