jdk
jdk copied to clipboard
8327512: JShell does not work correctly when a class named Object or Throwable is defined
When JShell wraps the user's snippets with additional code to make the standalone compilable units, it uses simple names to refer to Object, Throwable or SuppressWarnings in some cases. These may interact with user-defined class of the same names, leading to error while running the next snippet. E.g.:
jshell> class Object{}
| created class Object
jshell> 1
| Error:
| incompatible types: int cannot be converted to Object
| 1
| ^
The proposal here is to use qualified names when creating the snippet wrappers, and to more carefully produce simple names when analyzing expressions (fully qualified names should be used when a class with the same simple name has been introduced in a snippet).
Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
Issue
- JDK-8327512: JShell does not work correctly when a class named Object or Throwable is defined (Bug - P4)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18295/head:pull/18295
$ git checkout pull/18295
Update a local copy of the PR:
$ git checkout pull/18295
$ git pull https://git.openjdk.org/jdk.git pull/18295/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18295
View PR using the GUI difftool:
$ git pr show -t 18295
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18295.diff
Webrev
:wave: 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.
@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:
8327512: JShell does not work correctly when a class named Object or Throwable is defined
Reviewed-by: asotona
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 571 new commits pushed to the master branch:
- d9d926d6699b7b2e1fcce206cbe03e1de661c2ac: 8330145: Serial: Refactor SerialHeap::scan_evacuated_objs
- 1a6da3d5f0ac57e173340a117a9368c190a34e8b: 8330822: Remove ModRefBarrierSet::write_ref_array_work
- 281f9bdeb9d6870346b12e6c62a58f7984b1b133: 8330735: RISC-V: No need to move sp to tmp register in set_last_Java_frame
- daa5a4bd124d539daa3c67a3e29dcd0eee20c44d: 8330802: Desugar switch in Locale::createLocale
- 896107705615a3b9363b7a0a3e6703b20fedef70: 8309259: Reduce calls to MethodHandles.lookup() in jdk.internal.net.http.Stream
- 574ba1400e015bf579190828fbdf0618eed48bdf: 8330862: GCBarrierIRExample fails when a different GC is selected via the command line
- 550a1386222462cca10f79a66453d2f08431dfdf: 8306928: Duplicate variable assignement in jdk.internal.net.http.AuthenticationFilter#getCredentials
- 57ebd045eae8ef1bdb5ec96d5eb11d252e08e6bb: 8330153: C2: dump barrier information for all Mach nodes
- 58ad399d196bf2dd701df451004b7815b0820675: 8330821: Rename UnsafeCopyMemory
- 1d52234e199c7a38c059c0aa88aea2910f749d48: 8330704: Clean up non-standard use of /** comments in some langtools tests
- ... and 561 more: https://git.openjdk.org/jdk/compare/4d644674442e491b477bdbb5469a58aa9151d573...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.
@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.
@lahodaj This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!
/integrate
Going to push as commit a407dc9cbb48c4f66af51433067925605d3bc39d.
Since your change was applied there have been 631 commits pushed to the master branch:
- ea06129851be7bd9876685f74e35392874154179: 8322847: java.lang.classfile.BufWriter should specify @throws for its writeXXX methods
- b3bcc49491b8f8ad337eb4c06201a5468e5c1159: 8330181: Move PcDesc cache from nmethod header
- 1c238d43e81acf516297f26660059d0bab5b5b8a: 8319990: Update CLDR to Version 45.0
- ce9eac38191fa700afa3ac06b2b202576a11dd71: 8331113: createJMHBundle.sh support configurable maven repo mirror
- 5af6b45eefd227e3e046ca22a404ae8a23174160: 8330615: avoid signed integer overflows in zip_util.c readCen / hashN
- 4dfaa9b5bd4f9733e5a67d7c5b55eaa5ad4e27e4: 8329805: Deprecate for removal ObjectOutputStream.PutField.write
- b9927aa3a4c77812bfc53b14a6695ec436737661: 8329194: Cleanup Type::cmp definition and usage
- c9442014e561f8e1cb43a0e9f18a9a5ae2a7a2da: 8331031: unify os::dont_yield and os::naked_yield across Posix platforms
- 8031dabf8344108a1c225311f2f270764fb2bc00: 8331094: ZGC: GTest fails due to incompatible Windows version
- c9f8d0eff706d9ac59179afbb821367da09c9aae: 8331050: Serial: Remove unused _saved_mark_word in DefNewGeneration and TenuredGeneration
- ... and 621 more: https://git.openjdk.org/jdk/compare/4d644674442e491b477bdbb5469a58aa9151d573...master
Your commit was automatically rebased without conflicts.
@lahodaj Pushed as commit a407dc9cbb48c4f66af51433067925605d3bc39d.
:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.