Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from

Conversation

@lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Mar 26, 2021

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.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8255273: jshell crashes with UnsupportedOperationException: Should not get here.

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3220/head:pull/3220
$ git checkout pull/3220

Update a local copy of the PR:
$ git checkout pull/3220
$ git pull https://git.openjdk.java.net/jdk pull/3220/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3220

View PR using the GUI difftool:
$ git pr show -t 3220

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3220.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Mar 26, 2021

👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Mar 26, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Mar 26, 2021

@lahodaj The following label will be automatically applied to this pull request:

  • kulla

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the kulla label Mar 26, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Mar 26, 2021

Webrevs

Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle left a comment

looks sensible

@openjdk
Copy link

@openjdk openjdk bot commented Apr 12, 2021

@lahodaj This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

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

Reviewed-by: vromero

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 214 new commits pushed to the master branch:

  • f4e6395: 8264190: Harden TLS interop tests
  • 18bec9c: 8265084: [BACKOUT] 8264954: unified handling for VectorMask object re-materialization during de-optimization
  • 9dd9625: 8263763: Synthetic constructor parameters of enum are not considered for annotation indices
  • 1ee80e0: 8261355: No data buffering in SunPKCS11 Cipher encryption when the underlying mechanism has no padding
  • d84a7e5: 8264124: Update MXBean specification and implementation to extend mapping of CompositeType to records
  • 714ae54: 8258788: incorrect response to change in window insets [lanai]
  • f479437: 8265082: test/hotspot/jtreg/gc/g1/TestG1SkipCompaction.java fails validate-source
  • 27f4b27: 8264623: Change to Xcode 12.4 for building on Macos at Oracle
  • 7c20d97: 8265052: Break circular include dependency in objArrayOop.inline.hpp
  • b90ad76: 8233567: [TESTBUG] FocusSubRequestTest.java fails on macos
  • ... and 204 more: https://git.openjdk.java.net/jdk/compare/f3eed052367fc6f7adb19dd8afeaf5e654098aa0...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Apr 12, 2021
@lahodaj
Copy link
Contributor Author

@lahodaj lahodaj commented Apr 15, 2021

/integrate

@openjdk openjdk bot closed this Apr 15, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Apr 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 15, 2021

@lahodaj Since your change was applied there have been 274 commits pushed to the master branch:

  • e43aee5: 8262900: ToolBasicTest fails to access HTTP server it starts
  • c70589c: 8265227: Move Proc.java from security/testlibrary to test/lib
  • 7b61a42: 8265173: [test] divert spurious log output away from stream under test in ProcessBuilder Basic test
  • 4e90d74: 8048199: Replace anonymous inner classes with lambdas, where applicable, in JNDI
  • 6293299: 8264824: java/net/Inet6Address/B6206527.java doesn't close ServerSocket properly
  • 6b90715: 8265278: doc build fails after JDK-8262981
  • 0fee6ec: 8264318: Lanai: DrawHugeImageTest.java fails on apple M1
  • 81877f7: 8262501: jdk17 libjvm link failure with --as-needed and clock_gettime in librt
  • b23dbdb: 8257804: Test runtime/modules/ModuleStress/ModuleStressGC.java fails: 'package test defined in module jdk.test, exports list being walked' missing from stdout/stderr
  • 9d669c9: 8262981: Create implementation for NSAccessibilitySlider protocol
  • ... and 264 more: https://git.openjdk.java.net/jdk/compare/f3eed052367fc6f7adb19dd8afeaf5e654098aa0...master

Your commit was automatically rebased without conflicts.

Pushed as commit 325eecb.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants