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

8325936: jshell - crash on 'new Object().""' #17876

Conversation

SirYwell
Copy link
Member

@SirYwell SirYwell commented Feb 15, 2024

This fixes a crash in jshell when the target of a StringTemplate is not a processor. We only look up the process method if the type is actually a processor. The added test case fails without that fix.

Please let me know what you think of this fix, and if there are things that should be changed.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8325936: jshell - crash on 'new Object().""' (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17876/head:pull/17876
$ git checkout pull/17876

Update a local copy of the PR:
$ git checkout pull/17876
$ git pull https://git.openjdk.org/jdk.git pull/17876/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17876

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17876.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 15, 2024

👋 Welcome back hgreule! 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 changed the title JDK-8325936 8325936: jshell - crash on 'new Object().""' Feb 15, 2024
@openjdk
Copy link

openjdk bot commented Feb 15, 2024

@SirYwell The following labels will be automatically applied to this pull request:

  • compiler
  • kulla

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

@openjdk openjdk bot added compiler compiler-dev@openjdk.org kulla kulla-dev@openjdk.org labels Feb 15, 2024
Comment on lines -25 to -26
// key: compiler.err.cant.resolve.location.args
// key: compiler.misc.location
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this error was rather confusing, e.g.

Simple2.java:3: error: cannot find symbol
        System.out.println(e."\{e}");
                             ^
  symbol:   method process(StringTemplate)
  location: class String

It mentions the process method while it's not visible in the code. It also always came directly after e.g.

Simple2.java:3: error: not a processor type: String
        System.out.println(e."\{e}");

so it basically just caused 2 errors when there actually only is 1.

@SirYwell SirYwell marked this pull request as ready for review February 15, 2024 16:58
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 15, 2024
@mlbridge
Copy link

mlbridge bot commented Feb 15, 2024

Webrevs

resultType = syms.objectType;
}
} else {
if (interfaceType == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (interfaceType == null) {
if (interfaceType == null) {

@openjdk
Copy link

openjdk bot commented Mar 13, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 11, 2024

@SirYwell 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!

@SirYwell SirYwell closed this Apr 21, 2024
@SirYwell SirYwell deleted the fix/string-template-processor-type-fatal-error branch April 21, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler compiler-dev@openjdk.org kulla kulla-dev@openjdk.org rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants