8371356: [lworld] 'super' should be rejected in early construction context#1740
8371356: [lworld] 'super' should be rejected in early construction context#1740vicente-romero-oracle wants to merge 1 commit intoopenjdk:lworldfrom
Conversation
|
👋 Welcome back vromero! A progress list of the required criteria for merging this PR into |
|
@vicente-romero-oracle 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: 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 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
|
|
||
| class Inner9Test extends Medium { | ||
| Inner9Test() { | ||
| boolean check1 = Inner9Test.super.check; |
There was a problem hiding this comment.
Should the test also use Parent.super.check and Medium.super.check?
There was a problem hiding this comment.
in those cases javac already fails with:
error: not an enclosing class: ClassName
There was a problem hiding this comment.
I remember the original case provided uses Interface.super.staticField. So it's like we have this code in Medium instead; can we maybe make Inner9Test instead of Medium implement Parent?
There was a problem hiding this comment.
I couldn't reproduce the error with the original example in javac, the original example was tested on jshell, but when then the reporter went back to the original java code for which this issue was happening and the case in the JBS was the minimal standalone reproductor for the issue. Dunno what is the interaction with jshell that makes the difference though
|
/integrate |
|
Going to push as commit e50f031.
Your commit was automatically rebased without conflicts. |
|
@vicente-romero-oracle Pushed as commit e50f031. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
There is a bug in the algo to determine what is kosher and what is not in early construction contexts. The algo was not analyzing any static symbol. But according to the
JLS 25 15.11.2 Accessing Superclass Members using super:the previous code was checking this only for instance field accesses. The current fix corrects this bug
TIA
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1740/head:pull/1740$ git checkout pull/1740Update a local copy of the PR:
$ git checkout pull/1740$ git pull https://git.openjdk.org/valhalla.git pull/1740/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1740View PR using the GUI difftool:
$ git pr show -t 1740Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1740.diff
Using Webrev
Link to Webrev Comment