Skip to content

8364213: (bf) Improve java/nio/Buffer/GetChars.java test comments #26512

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

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

Conversation

bokken
Copy link
Contributor

@bokken bokken commented Jul 28, 2025

Address code review comments which came in post integration/merge of #26282.

Update/clarify test summary tag
Document the values generated for arguments
Move the endian-ness qualifier in the test descriptor string to not be first
Change test method names to more closely match arg names of method under test


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

Issues

  • JDK-8364213: (bf) Improve java/nio/Buffer/GetChars.java test comments (Bug - P4)
  • JDK-8364345: Test java/nio/Buffer/CharBufferAsCharSequenceTest.java failed (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26512

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

Using diff file

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

Using Webrev

Link to Webrev Comment

Address code review comments which came in post integration/merge.

Update/clarify test summary tag
Document the values generated for arguments
Move the endian-ness qualifier in the test descriptor string to not be
first
Change test method names to more closely match arg names of method under
test
@bridgekeeper
Copy link

bridgekeeper bot commented Jul 28, 2025

👋 Welcome back bokken! 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 Jul 28, 2025

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

@openjdk openjdk bot changed the title 8364213: (bf) Improve java/nio/Buffer/GetChars.java test comment 8364213: (bf) Improve java/nio/Buffer/GetChars.java test comments Jul 28, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 28, 2025
@openjdk
Copy link

openjdk bot commented Jul 28, 2025

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

  • nio

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.

@mlbridge
Copy link

mlbridge bot commented Jul 28, 2025

Webrevs

@bokken
Copy link
Contributor Author

bokken commented Jul 28, 2025

@AlanBateman - this is addressing your comments in prior review

* <li>int stop - index (exclusive) into char[] where the CharBuffer should be limited</li>
* <li>String - description of the test scenario</li>
* </ul>
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

That helps a bit but I think we need to break up charBufferArguments into simpler/maintainable methods that have clear comments to document the test cases that they generate. Right now it's just way too hard to see what is tested and not tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have started by adding more documentation to the "random" tests.
I agree this makes it much easier to reason about what scenarios are covered.
It is actually making me wonder if the "static" tests are even worth keeping.

fix for random range generation (JDK-8364345)
@openjdk openjdk bot removed the rfr Pull request is ready for review label Jul 30, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 30, 2025
@bokken
Copy link
Contributor Author

bokken commented Jul 30, 2025

/issue 8364345

@openjdk
Copy link

openjdk bot commented Jul 30, 2025

@bokken
Adding additional issue to issue list: 8364345: Test java/nio/Buffer/CharBufferAsCharSequenceTest.java failed.

cb.position(start);
cb.limit(end);
return cb;
}

/**
* Generates random content to use for populating <i>cb</i> then calling through to {@code addCases(String, char[], CharBuffer, List)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to keep the line lengths under 100 chars (80 is better).
It makes it possible to do size-by-size reviews that some reviewers prefer.

@openjdk openjdk bot removed the rfr Pull request is ready for review label Jul 30, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nio [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants