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

8248383: Clarify java.io.Reader.read(char[], ...) behavior for full array #1737

Closed
wants to merge 12 commits into from

Conversation

bplb
Copy link
Member

@bplb bplb commented Dec 10, 2020

Please review this small verbiage change to specify clearly the behavior of Reader::read(char[] cbuf) when the length of cbuf is zero, and that of Reader::read(char[] cbuf, int off, int len) when len is zero.


Progress

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

Issue

  • JDK-8248383: Clarify java.io.Reader.read(char[], ...) behavior for full array

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1737/head:pull/1737
$ git checkout pull/1737

@bplb
Copy link
Member Author

bplb commented Dec 10, 2020

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 10, 2020

👋 Welcome back bpb! 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 rfr Pull request is ready for review csr Pull request needs approved CSR before integration labels Dec 10, 2020
@openjdk
Copy link

openjdk bot commented Dec 10, 2020

@bplb has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@bplb please create a CSR request and add link to it in JDK-8248383. This pull request cannot be integrated until the CSR request is approved.

@openjdk
Copy link

openjdk bot commented Dec 10, 2020

@bplb 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 Dec 10, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 10, 2020

Webrevs

Copy link
Contributor

@LanceAndersen LanceAndersen left a comment

Choose a reason for hiding this comment

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

Hi Brian,

Are there existing tests that cover the behavior described in the proposed change?

@bplb
Copy link
Member Author

bplb commented Dec 10, 2020

Hi @LanceAndersen. I don't see any tests specific to this issue, but then there are ten Reader classes in java.io, seven of which are not abstract.

Copy link
Member

@naotoj naotoj 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 to me, Brian.

@openjdk
Copy link

openjdk bot commented Dec 10, 2020

⚠️ @bplb This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@bplb
Copy link
Member Author

bplb commented Dec 10, 2020

For the sake of sanity I added a minimal test to verify that the behavior is in fact in accord with the added verbiage.

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

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

Somewhat odd that the files changed includes merged file from a different changeset
but seems immaterial to the changes for the issue.

* @summary Ensure that zero is returned for read into zero length array
*/
public class ReadIntoZeroLengthArray {
private static char[] cbuf0 = new char[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

I would encourage the use of TestNG for new tests and they provide a good DataProvider framework for multiple test cases. (And frequently they run more quickly because they can be run in the jtreg process without spawing a separate process).

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the extra commits are because I put some commits on the master branch and then merged them into the feature branch. I believe the integration will merge them correctly.

I converted the test to TestNG. I've used it a number of times before to good effect (cf. java/nio/Buffer/BulkPutBuffer.java) but was too lazy to review the annotations again. Thanks for the suggestion.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Dec 17, 2020
@openjdk
Copy link

openjdk bot commented Dec 17, 2020

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

8248383: Clarify java.io.Reader.read(char[], ...) behavior for full array

Reviewed-by: naoto, smarks, rriggs

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 80 new commits pushed to 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 Dec 17, 2020
@bplb
Copy link
Member Author

bplb commented Dec 17, 2020

/integrate

@openjdk openjdk bot closed this Dec 17, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 17, 2020
@openjdk
Copy link

openjdk bot commented Dec 17, 2020

@bplb Since your change was applied there have been 83 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 143998e.

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

@bplb bplb deleted the JDK-8248383-Reader-read branch December 17, 2020 16:33
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.

8 participants