8352638: Enhance code consistency: java.desktop/windows #24170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
java.desktop
module currently lacks proper use of the@Override
annotation for methods and thefinal
modifier for classes. While similar changes were previously made in the JavaSound (and some of the classes on demand), these changes are not as critical now due to the new jdk "encapsulation", but they are still useful for improving code consistency.To make the code review process easier I have made the following changes:
java.desktop/windows
as the starting package because it contains a relatively small number of classesfinal
modifier from methods since they were already defined in final classesNote: I will submit additional patches in this area later because:
@Override
andfinal
were modified to keep the diff clear - header dates were not updated (that could be covered by one patch similar to this)@Override
for anonymous classesAny feedback or suggestions are welcome!
Here is a link to a simple diff file, it might be more convenient for reviewing the changes.
To download the diff file and filter only the modified lines you can use the following script:
The build was successful, and I ran all the open jtreg tests without issues. But it's possible that some closed tests may be affected by these changes. It would be good to verify this by mach5 to ensure everything works as expected.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24170/head:pull/24170
$ git checkout pull/24170
Update a local copy of the PR:
$ git checkout pull/24170
$ git pull https://git.openjdk.org/jdk.git pull/24170/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24170
View PR using the GUI difftool:
$ git pr show -t 24170
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24170.diff
Using Webrev
Link to Webrev Comment