8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer#21730
8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer#21730mkarg wants to merge 17 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back mkarg! A progress list of the required criteria for merging this PR into |
|
@mkarg 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: 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 35 new commits pushed to the
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 (@liach, @jaikiran, @RogerRiggs) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
/csr |
|
@mkarg has indicated that a compatibility and specification (CSR) request is needed for this pull request. @mkarg please create a CSR request for issue JDK-8343110 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
|
Sorry for belated mail response, but I think we should design the API to not take source start/end. I think JIT can escape analysis the new String in practice. |
Chen, thank you for chiming in! There is nothing to be sorry, I was just posting drafts so far! 🙂 Regarding your actual question, I do understand your idea and while originally I had the same in mind (it really is appealing!), I came up with a draft using the original
|
|
Hi Markus, I recommend to continue the discussion on the mailing list instead of on GitHub. Note that GitHub pull requests are only forwarded to the mailing list when it's ready for review, and this proposal is way too early. (And the CSR is too early, too: we should agree on an API surface, such as exception contracts, first) Sorry that no one has responded to you yet, but many engineers are busy with other areas, such as pushing the JEPs (as you see, we have a huge number of candidate/submitted JEPs right now, and JDK 24 RDP1 is just 6 weeks away). They are monitoring your core-libs thread, stay assured! |
|
@liach Agreed with all you say, but actually: I did not expect any response - in particular on a weekend! I do not know why apparently people started to review the draft documents. I just filed it for no other purpose than taking note of its existence. 🤔 I thought it is pretty clear to everybody that draft means "do not review". At least this is how I used draft documents in the past 30 years. 🙂 So it seems there was a misunderstanding here regarding my drafts. My intention ever was and still is to first finish the discussion about alternatives (A)...(E) on the core-lib mailing list first. My PR and CSR drafts are intentionally in draft state, which means, they are not open for review yet (there is no |
|
@mkarg This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 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! |
|
Kindly asking anybody's contribution to the ongoing discussion on the core-devs mailing list. Thanks you. |
|
@mkarg this pull request can not be integrated into git checkout getchars
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
Webrevs
|
|
@mkarg 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! |
Kindly asking for more comments! Something I am missing? Some good reason to not adopt my proposal? |
|
Hello Markus, it's been a while since this PR was merged with latest master branch in mainline. Could you update the PR to do that? |
As rebasing is not wanted in OpenJDK, do you mean merging |
Yes, that's correct. That should then run the GitHub actions job against this PR against a more relevant state of this PR. Since things have settled and the CSR approved, I'll also run this PR against our CI to verify nothing fails unexpectedly. I will anyway be doing the merge against master locally before submitting for tier testing, but it's always a good practice to keep the PR updated with latest master changes, when the master branch has seen too many commits since the PR was opened. |
Yes that is pretty clear. I'm using git since decades but always do rebase in all other project, so my question was only about how to perform the update. 🙂 |
Locally, if your remote repo that points to github.com/openjdk/jdk is named If there are no merge resolution conflicts, then those command should be enough and your local Once you build and test locally you can then push those changes from |
|
I know all that. As I said, I am using git since decades, so I know lots of alternative ways to update branches and even proposed the one you want, so I just needed to know which of those alternatives (not the exact commands) you want. Don't know why posted all that, as the question was already solved by you?! 🤔 |
Updated to current |
|
Github Actions have successfully passed all checks. ✔️ 😄 |
jaikiran
left a comment
There was a problem hiding this comment.
tier1 through tier3 testing of this PR passed without issues. The CSR has been approved and the changes in this PR look good to me.
Thank you for being patient and contributing this enhancement.
Thank you, Jaikiran! Will this result convince everybody to actively mark this PR as officially reviewed, so I can finally integrate it? 😃 |
@liach For example, you could approve your outdated approval so this PR finally has to current reviews. Thanks.
|
RogerRiggs
left a comment
There was a problem hiding this comment.
Thanks for the persistence.
|
/integrate |
liach
left a comment
There was a problem hiding this comment.
The latest iteration looks the same as the one I last reviewed.
|
/sponsor |
|
Going to push as commit 7642556.
Your commit was automatically rebased without conflicts. |
| * characters are copied into the subarray of {@code dst} starting | ||
| * at index {@code dstBegin} and ending at index: | ||
| * <pre>{@code | ||
| * dstbegin + (srcEnd-srcBegin) - 1 |
There was a problem hiding this comment.
Shouldn't it be dstBegin?
* dstBegin + (srcEnd-srcBegin) - 1
There was a problem hiding this comment.
Hello Andrey, what you note is right. This and the other change you have proposed to this text seems reasonable. Do you want to create a JBS issue and raise a PR proposing this change?
There was a problem hiding this comment.
We could also simply include it in the PR for https://bugs.openjdk.org/browse/JDK-8356679 to reduce organizational overhead.
There was a problem hiding this comment.
Hello Markus, it's OK to do this text change as part of JDK-8356679. Like Roger noted in the corresponding core-libs-dev mailing list, it would be good to do the 8356679 changes in smaller pieces and include this change in one of those.
| * <li>{@code srcEnd} is greater than | ||
| * {@code this.length()}. | ||
| * <li>{@code dstBegin+srcEnd-srcBegin} is greater than | ||
| * {@code dst.length} |
There was a problem hiding this comment.
I think we should have . at the end of each case. Now it's inconsistent
This Pull Request proposes an implementation for JDK-8343110: Adding the new method
public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)to theCharSequenceinterface, providing a bulk-read facility including a default implementation iterating overcharAt(int).In addition, this Pull Request proposes to replace the implementation of
Reader.of(CharSequence).read(char[] cbuf, int off, int len)to invokeCharSequence.getChars(next, next + n, cbuf, off)instead of utilizing pattern matching for switch. Also, this PR proposes to implementCharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)as an alias forCharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin).To ensure quality...
AbstractStringBuilder.getChars(...).Reader.of(CharSequence), as these provide sufficient coverage of all changes introduced by this PR.Progress
Issues
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21730/head:pull/21730$ git checkout pull/21730Update a local copy of the PR:
$ git checkout pull/21730$ git pull https://git.openjdk.org/jdk.git pull/21730/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21730View PR using the GUI difftool:
$ git pr show -t 21730Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21730.diff
Using Webrev
Link to Webrev Comment