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
8265900: Use pattern matching for instanceof at module jdk.compiler(part 2) #3674
Conversation
|
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one minor nit comment
@@ -753,8 +753,8 @@ public void finalizeScope() { | |||
} | |||
|
|||
protected Scope finalizeSingleScope(Scope impScope) { | |||
if (impScope instanceof FilterImportScope && impScope.owner.kind == Kind.TYP && | |||
((FilterImportScope) impScope).isStaticallyImported()) { | |||
if (impScope instanceof FilterImportScope filterImportScope && impScope.owner.kind == Kind.TYP && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
break vertically on each &&
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} else { | ||
return false; | ||
} | ||
return (obj instanceof UniquePos uniquePos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For another day - UniquePos can be a record :-)
} else { | ||
return false; | ||
} | ||
return (obj instanceof BsmKey key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BsmKey smells of records too...
@lgxbslgx This change now passes all automated pre-integration checks. 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 19 new commits pushed to the
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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@mcimadamore) but any other Committer may sponsor as well.
|
Mailing list message from Brian Goetz on compiler-dev: Also, FYI: we had a discussion over a similar topic over on corelibs, On 4/26/2021 9:55 AM, Maurizio Cimadamore wrote: -------------- next part -------------- |
Mailing list message from Guoxiong Li on compiler-dev: Hi Brian, Thank you for your reminder. It is a good suggestion about code readability. -- On Mon, Apr 26, 2021 at 10:04 PM Brian Goetz <brian.goetz at oracle.com> wrote: -------------- next part -------------- |
@mcimadamore I updated the code. Could I get your help to re-review and sponsor? Thanks a lot. /integrate |
/sponsor |
@mcimadamore @lgxbslgx Since your change was applied there have been 22 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 082abbd. |
Hi all,
This series of patches update the code of the module jdk.compiler by using the pattern matching for instanceof.
This patch would revise the following packages:
Thank you for taking the time to review.
--
Best Regards,
Guoxiong.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3674/head:pull/3674
$ git checkout pull/3674
Update a local copy of the PR:
$ git checkout pull/3674
$ git pull https://git.openjdk.java.net/jdk pull/3674/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3674
View PR using the GUI difftool:
$ git pr show -t 3674
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3674.diff