-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8364317: Explicitly document some assumptions of StringUTF16 #26541
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
Conversation
👋 Welcome back liach! A progress list of the required criteria for merging this PR into |
@liach 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 44 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. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good initiative, thanks @liach.
Maybe some words about endianness would be useful as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
@rgiulietti: I have added a paragraph describing the layout constraints of UTF16 byte arrays. Please check it out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine
@liach, given the relatively big API surface of |
I am. In fact, your update to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liach, given the relatively big API surface of j.l.StringUTF16, are we certain about this?
I am. In fact, your update to use
char
made it less correct - there are a few APIs that take LATIN1 byte arrays, for which number of chars is equivalent to number of bytes.
Thanks for taking care of these details Chen, much appreciated. Changes LGTM.
Thanks for the reviews! I hope a random future commit might pick up that extra space as a gratituity. /integrate |
Going to push as commit fe09e93.
Your commit was automatically rebased without conflicts. |
In #24773, people were concerned that the layout of a UTF16 byte array and a char array may be incompatible. In fact, they are - they are asserted in a corner in
LibraryCallKit::inline_string_char_access
inlibrary_call.cpp
.In addition, another frequent error I see is that contributors have confused the meaning of indices in StringUTF16 - the indices are always in char array indices. I think we should make these explicit to help future maintenance.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26541/head:pull/26541
$ git checkout pull/26541
Update a local copy of the PR:
$ git checkout pull/26541
$ git pull https://git.openjdk.org/jdk.git pull/26541/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26541
View PR using the GUI difftool:
$ git pr show -t 26541
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26541.diff
Using Webrev
Link to Webrev Comment