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

8352638: Enhance code consistency: java.desktop/windows #24170

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mrserb
Copy link
Member

@mrserb mrserb commented Mar 22, 2025

The java.desktop module currently lacks proper use of the @Override annotation for methods and the final 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:

  1. I chose java.desktop/windows as the starting package because it contains a relatively small number of classes
  2. The public API was not affected so there is no need to worry about a CSR
  3. In a few places I removed the final modifier from methods since they were already defined in final classes

Note: I will submit additional patches in this area later because:

  1. Only lines with @Override and final were modified to keep the diff clear - header dates were not updated (that could be covered by one patch similar to this)
  2. I skipped adding @Override for anonymous classes

Any 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:

curl -s https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24170.diff -o d.txt && grep -E '^\+|^\-' d.txt

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

  • 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-8352638: Enhance code consistency: java.desktop/windows (Bug - P5)

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 22, 2025

👋 Welcome back serb! 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
Copy link

openjdk bot commented Mar 22, 2025

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

@openjdk
Copy link

openjdk bot commented Mar 22, 2025

@mrserb The following label will be automatically applied to this pull request:

  • client

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

@mrserb mrserb marked this pull request as ready for review March 24, 2025 18:23
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 24, 2025
@mlbridge
Copy link

mlbridge bot commented Mar 24, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant