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

8274394: Use Optional.isEmpty instead of !Optional.isPresent in jdk.jlink #5707

Closed

Conversation

turbanoff
Copy link
Member

@turbanoff turbanoff commented Sep 26, 2021

I propose to replace usages of !Optional.isPresent() with Optional.isEmpty method.
It's makes code a bit easier to read.
Noticing negation before long chain of method calls is hard.


Progress

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

Issue

  • JDK-8274394: Use Optional.isEmpty instead of !Optional.isPresent in jdk.jlink

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5707

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 26, 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 27, 2021

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

  • core-libs

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.

@openjdk openjdk bot added the core-libs label Sep 27, 2021
@turbanoff turbanoff changed the title [PATCH] Use Optional.isEmpty instead of !Optional.isPresent in jdk.jlink 8274394: Use Optional.isEmpty instead of !Optional.isPresent in jdk.jlink Sep 27, 2021
@openjdk openjdk bot added the rfr label Sep 27, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 27, 2021

Webrevs

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Looks okay, this code pre-dates the isEmpty method.

@openjdk
Copy link

@openjdk openjdk bot commented Sep 28, 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:

8274394: Use Optional.isEmpty instead of !Optional.isPresent in jdk.jlink

Reviewed-by: alanb, mchung

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

  • b36881f: 8274383: JNI call of getAccessibleSelection on a wrong thread
  • be40373: 8274381: missing CAccessibility definitions in JNI code
  • 79865cd: 8274259: G1: assert(check_alignment(result)) failed: address not aligned: 0x00000008baadbabe after JDK-8270009
  • 961dcff: 8273581: Change the mechanism by which JDK loads the platform-specific FontManager class
  • 6a573b8: 8273508: Support archived heap objects in SerialGC
  • 3eca9c3: 8264707: HotSpot Style Guide should permit use of lambda
  • af50772: 8231640: (prop) Canonical property storage
  • ddc2627: 8273790: Potential cyclic dependencies between Gregorian and CalendarSystem
  • 633eab2: 8174819: java/nio/file/WatchService/LotsOfEvents.java fails intermittently
  • 8876eae: 8269685: Optimize HeapHprofBinWriter implementation
  • ... and 14 more: https://git.openjdk.java.net/jdk/compare/7700b25460b9898060602396fed7bc590ba242b8...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 (@AlanBateman, @mlchung) 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 Sep 28, 2021
Copy link
Member

@mlchung mlchung left a comment

LGTM

@turbanoff
Copy link
Member Author

@turbanoff turbanoff commented Sep 28, 2021

/integrate

@openjdk openjdk bot added the sponsor label Sep 28, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Sep 28, 2021

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

@mlchung
Copy link
Member

@mlchung mlchung commented Sep 28, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Sep 28, 2021

Going to push as commit 6f4cefb.
Since your change was applied there have been 25 commits pushed to the master branch:

  • 94f5e80: 8274276: Cache normalizedBase URL in URLClassPath.FileLoader
  • b36881f: 8274383: JNI call of getAccessibleSelection on a wrong thread
  • be40373: 8274381: missing CAccessibility definitions in JNI code
  • 79865cd: 8274259: G1: assert(check_alignment(result)) failed: address not aligned: 0x00000008baadbabe after JDK-8270009
  • 961dcff: 8273581: Change the mechanism by which JDK loads the platform-specific FontManager class
  • 6a573b8: 8273508: Support archived heap objects in SerialGC
  • 3eca9c3: 8264707: HotSpot Style Guide should permit use of lambda
  • af50772: 8231640: (prop) Canonical property storage
  • ddc2627: 8273790: Potential cyclic dependencies between Gregorian and CalendarSystem
  • 633eab2: 8174819: java/nio/file/WatchService/LotsOfEvents.java fails intermittently
  • ... and 15 more: https://git.openjdk.java.net/jdk/compare/7700b25460b9898060602396fed7bc590ba242b8...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Sep 28, 2021
@openjdk openjdk bot added integrated and removed ready rfr sponsor labels Sep 28, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Sep 28, 2021

@mlchung @turbanoff Pushed as commit 6f4cefb.

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

@turbanoff turbanoff deleted the use_optional_empty_jdk.link branch Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs integrated
3 participants