8373668: Add override keyword to *Klass classes#28820
8373668: Add override keyword to *Klass classes#28820xmas92 wants to merge 2 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back aboldtch! A progress list of the required criteria for merging this PR into |
|
@xmas92 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 12 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. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
kimbarrett
left a comment
There was a problem hiding this comment.
Looks good.
A couple of pre-existing whitespace issues that you can fix or ignore.
I wonder if there would be any measurable benefit to using final instead in some
cases? But that should be looked at separately. It might be simpler to declare some
classes to be final.
I know that I experimented with this at some point for the oop iterator. The result then was that it was not a reliable way to guarantee de-virtualisation. I also remember reading some blog post somewhere which explored different compilers and the benefits of final. I think it ultimately was not reliable enough to replace doing hand rolling things for where it matters, but got some improvements in some cases. However this was a few years ago so things might have improved. Regardless of performance improvements, I think the final keyword makes the intended inheritance more clear and would be a worthwhile future RFE. |
TheShermanTanker
left a comment
There was a problem hiding this comment.
+1 for use of helpful C++ features!
dholmes-ora
left a comment
There was a problem hiding this comment.
This all seems reasonable. I hope an IDE assisted with determining where override was needed, and virtual was not.
I think it would be good to see things marked final in the future as well.
|
Thanks for the reviews. (Rebuilt with latest master merged locally.) |
|
Going to push as commit 78c2d57.
Your commit was automatically rebased without conflicts. |
Using override provides better visibility and compiler support for suspicious virtual methods. It makes it clears when reading a class header file if a new virtual interface is introduced or if it simply overridden.
Testing
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28820/head:pull/28820$ git checkout pull/28820Update a local copy of the PR:
$ git checkout pull/28820$ git pull https://git.openjdk.org/jdk.git pull/28820/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28820View PR using the GUI difftool:
$ git pr show -t 28820Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28820.diff
Using Webrev
Link to Webrev Comment