RFR: 8255273: jshell crashes with UnsupportedOperationException: Should not get here.

Vicente Romero vromero at openjdk.java.net
Mon Apr 12 21:01:37 UTC 2021


On Fri, 26 Mar 2021 16:45:34 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> Consider JShell interaction like:
> 
> 
> jshell> import java.time.*;
> 
> jshell> new Instant<tab>
> 
> 
> This will crash the JShell with an `UnsupportedOperationException`. The ultimately reason is that:
> -completions are computed, and are `InstantiationError(` and `InstantiationException(`, with a common prefix `InstantiationE`
> -documentation is computed, and is for java.time.Instant
> 
> The completion state machine then gets into a state where it fills in the common prefix, and then it would like say something along the lines of "Press tab once more to see signature/documentation.", but that does not make much sense (as the documentation is computed for a wrong input - the new input is `new InstantiationE`, not `Instant`, so the documentation is already invalid for that.
> 
> (The `UnsupportedOperationException` is in place where the "Press tab once more to see signature/documentation." should happen, because the code should not get into a state like this.)
> 
> The proposed solution is to cancel the documentation if a prefix is (to be) filled.

looks sensible

-------------

Marked as reviewed by vromero (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3220


More information about the kulla-dev mailing list