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

8274640: Cleanup unnecessary null comparison before instanceof check in java.desktop #5482

Conversation

turbanoff
Copy link
Member

@turbanoff turbanoff commented Sep 11, 2021

Updated code checks both non-null and instance of a class in java.desktop module classes.
The checks and explicit casts could also be replaced with pattern matching for the instanceof operator.
Similar cleanups

  1. JDK-8273484 java.naming
  2. JDK-8258422 java.base

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8274640: Cleanup unnecessary null comparison before instanceof check in java.desktop

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5482/head:pull/5482
$ git checkout pull/5482

Update a local copy of the PR:
$ git checkout pull/5482
$ git pull https://git.openjdk.java.net/jdk pull/5482/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5482

View PR using the GUI difftool:
$ git pr show -t 5482

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5482.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 11, 2021

👋 Welcome back turbanoff! 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 openjdk bot commented Sep 11, 2021

@turbanoff The following labels will be automatically applied to this pull request:

  • client
  • i18n

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

@openjdk openjdk bot added client i18n labels Sep 11, 2021
@turbanoff turbanoff marked this pull request as ready for review Sep 12, 2021
@turbanoff turbanoff marked this pull request as draft Sep 12, 2021
@turbanoff turbanoff marked this pull request as ready for review Sep 12, 2021
@turbanoff turbanoff changed the title [PATCH] Cleanup unnecessary null comparison before instanceof check in java.desktop 8274640: Cleanup unnecessary null comparison before instanceof check in java.desktop Oct 1, 2021
@openjdk openjdk bot added the rfr label Oct 1, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 1, 2021

Webrevs

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 29, 2021

@turbanoff This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@turbanoff
Copy link
Member Author

@turbanoff turbanoff commented Nov 24, 2021

not yet, bot

@openjdk
Copy link

@openjdk openjdk bot commented Nov 29, 2021

@turbanoff 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:

8274640: Cleanup unnecessary null comparison before instanceof check in java.desktop

Reviewed-by: aivanov

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 1068 new commits pushed to the master branch:

  • 8907003: 8272234: Pass originating elements from Filer to JavaFileManager
  • 0fbd271: 8278115: gc/stress/gclocker/TestGCLockerWithSerial.java has duplicate -Xmx
  • bef5c7a: 8278116: runtime/modules/LoadUnloadModuleStress.java has duplicate -Xmx
  • 473ecec: 8278174: runtime/cds/appcds/LambdaWithJavaAgent.java fails with release VMs
  • 19ce33d: 8258512: serviceability/sa/TestJmapCore.java timed out on macOS 10.13.6
  • c93552c: 8277069: [REDO] JDK-8276743 Make openjdk build Zip Archive generation "reproducible"
  • b8ac0d2: 8276681: Additional malformed Javadoc inline tags in JDK source
  • b310f30: 8277396: [TESTBUG] In DefaultButtonModelCrashTest.java, frame is accessed from main thread
  • 15345e3: 8276661: (fs) UserDefinedFileAttributeView no longer works with long path (win)
  • 652b5f8: 8276674: Malformed Javadoc inline tags in JDK source
  • ... and 1058 more: https://git.openjdk.java.net/jdk/compare/f189dff5cbd4d47e1b2f3c0e5f2c866a7effccdf...master

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 (@aivanov-jdk) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Nov 29, 2021
@aivanov-jdk
Copy link
Member

@aivanov-jdk aivanov-jdk commented Nov 29, 2021

/reviewers 2

The change is not too complicated, however, given the number of files modified, I'd like another reviewer to look through the changes before it's integrated.

@openjdk
Copy link

@openjdk openjdk bot commented Nov 29, 2021

@aivanov-jdk
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@openjdk openjdk bot removed the ready label Nov 29, 2021
@aivanov-jdk
Copy link
Member

@aivanov-jdk aivanov-jdk commented Dec 2, 2021

/reviewers 1

I guess it isn't worth waiting any longer. There has been lots of time for others to take a look. If an issue is found later, it can be fixed as easily.

@openjdk
Copy link

@openjdk openjdk bot commented Dec 2, 2021

@aivanov-jdk
The number of required reviews for this PR is now set to 1.

@openjdk openjdk bot added the ready label Dec 2, 2021
@turbanoff
Copy link
Member Author

@turbanoff turbanoff commented Dec 3, 2021

/integrate

@openjdk openjdk bot added the sponsor label Dec 3, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 3, 2021

@turbanoff
Your change (at version 5a8cf2f) is now ready to be sponsored by a Committer.

@aivanov-jdk
Copy link
Member

@aivanov-jdk aivanov-jdk commented Dec 3, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Dec 3, 2021

Going to push as commit 18c54b4.
Since your change was applied there have been 1073 commits pushed to the master branch:

  • dda8f26: 8278139: G1: Refactor G1BlockOffsetTablePart::block_at_or_preceding
  • e4774e6: 8277916: Gather non-strong reference count logic in a single place
  • 53df9ff: 8278154: SimpleFileServer#createFileServer() should specify that the returned server is not started
  • d1cad24: 8278168: Add a few missing words to the specification of Files.mismatch
  • 45da3ae: 8278163: --with-cacerts-src variable resolved after GenerateCacerts recipe setup
  • 8907003: 8272234: Pass originating elements from Filer to JavaFileManager
  • 0fbd271: 8278115: gc/stress/gclocker/TestGCLockerWithSerial.java has duplicate -Xmx
  • bef5c7a: 8278116: runtime/modules/LoadUnloadModuleStress.java has duplicate -Xmx
  • 473ecec: 8278174: runtime/cds/appcds/LambdaWithJavaAgent.java fails with release VMs
  • 19ce33d: 8258512: serviceability/sa/TestJmapCore.java timed out on macOS 10.13.6
  • ... and 1063 more: https://git.openjdk.java.net/jdk/compare/f189dff5cbd4d47e1b2f3c0e5f2c866a7effccdf...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 3, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 3, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 3, 2021

@aivanov-jdk @turbanoff Pushed as commit 18c54b4.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@openjdk openjdk bot removed the sponsor label Dec 3, 2021
@turbanoff turbanoff deleted the cleanup_unnecessary_null_check_before_instanceof_java.desktop branch Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client i18n integrated
2 participants