Skip to content

Conversation

@jddarcy
Copy link
Member

@jddarcy jddarcy commented Jun 22, 2023

Small cleanup, minor differences in the wording of portions of toString(Object, String), nonNull(Object), requireNonNullElse, and requireNonNullElseGet.


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

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14608/head:pull/14608
$ git checkout pull/14608

Update a local copy of the PR:
$ git checkout pull/14608
$ git pull https://git.openjdk.org/jdk.git pull/14608/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14608

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14608.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 22, 2023

👋 Welcome back darcy! 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 openjdk bot added the rfr Pull request is ready for review label Jun 22, 2023
@openjdk
Copy link

openjdk bot commented Jun 22, 2023

@jddarcy 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 core-libs-dev@openjdk.org label Jun 22, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 22, 2023

Webrevs

Copy link
Member

@stuart-marks stuart-marks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I had to refresh my understanding of the exact behavior of the inline @return tag:

https://docs.oracle.com/en/java/javase/17/docs/specs/javadoc/doc-comment-spec.html

(search for {@return)

It adds a leading "Returns " and a trailing "." to the block's text, and inserts a "Returns" section in the proper place. This seems oddly specific, but it's tailored for this exact use case. Anyway, good cleanup.

@openjdk
Copy link

openjdk bot commented Jun 22, 2023

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

8310571: Use inline @return tag on java.util.Objects

Reviewed-by: smarks

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

  • dad7bd9: 8310234: Refactor Locale tests to use JUnit
  • 69f3114: 8310676: add note about unnamed module to Elements.getAllModuleElements
  • bfcca5e: 8310494: Do not include constantPool.hpp from instanceKlass.hpp

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 22, 2023
@pavelrappo
Copy link
Member

pavelrappo commented Jun 22, 2023

I can see that Objects.hash(Object...) was not changed in this PR. Although I think I can see why, I wonder if any distinctions between "Generates" and "Returns" are not important in that context:

   /**
    * Generates a hash code for a sequence of input values. The hash
...
    * @return a hash value of the sequence of input values
...
    */
    public static int hash(Object... values) {

Copy link
Member

@pavelrappo pavelrappo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this, Joe. It seems that I have made multiple comments on the same issue. It makes me wonder if that isn't an issue at all, but is a deliberate choice made in this PR.

Comment on lines 143 to 145
* {@return the result of calling {@code toString} on the first
* argument if the first argument is not {@code null} and returns
* the second argument otherwise.
* the second argument otherwise}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This "returns" in "and returns" feels non-DRY and brittle. We enclosed that word in {@return} already. Maybe we could use the wording from the original @return to avoid the verb altogether?

This is of course, a personal opinion.

/**
* Returns {@code true} if the provided reference is {@code null} otherwise
* returns {@code false}.
* {@return {@code true} if the provided reference is {@code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my previous comment on the "returns" verb in the doc comment for toString(Object, String). Here (IMO), you picked the better of the two options.

Comment on lines 283 to 284
* {@return the first argument if it is non-{@code null} and
* otherwise returns the non-{@code null} second argument}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment for "returns".

Comment on lines 299 to 300
* {@return the first argument if it is non-{@code null} and otherwise
* returns the non-{@code null} value of {@code supplier.get()}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

@jddarcy
Copy link
Member Author

jddarcy commented Jun 23, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Jun 23, 2023

Going to push as commit 0db63ec.
Since your change was applied there have been 3 commits pushed to the master branch:

  • dad7bd9: 8310234: Refactor Locale tests to use JUnit
  • 69f3114: 8310676: add note about unnamed module to Elements.getAllModuleElements
  • bfcca5e: 8310494: Do not include constantPool.hpp from instanceKlass.hpp

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 23, 2023
@openjdk openjdk bot closed this Jun 23, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 23, 2023
@openjdk
Copy link

openjdk bot commented Jun 23, 2023

@jddarcy Pushed as commit 0db63ec.

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

@jddarcy jddarcy deleted the JDK-8310571 branch October 17, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants