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

Jan Lahoda jlahoda at openjdk.java.net
Thu Apr 15 16:20:38 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.

This pull request has now been integrated.

Changeset: 325eecbc
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/325eecbc
Stats:     101 lines in 2 files changed: 60 ins; 27 del; 14 mod

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

Reviewed-by: vromero

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

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


More information about the kulla-dev mailing list