8321514: UTF16 string gets constructed incorrectly from codepoints if CompactStrings is not enabled

Co-authored-by: Roger Riggs <rriggs@openjdk.org>
Reviewed-by: rriggs
This commit is contained in:
Aleksei Voitylov 2023-12-14 14:39:04 +00:00 committed by Roger Riggs
parent 45a9ade337
commit fde5b16817
2 changed files with 27 additions and 2 deletions

View file

@ -415,7 +415,7 @@ final class StringUTF16 {
int n = computeCodePointSize(val, index, end);
byte[] buf = newBytesFor(n);
return extractCodepoints(val, index, len, buf, 0);
return extractCodepoints(val, index, end, buf, 0);
}
public static byte[] toBytes(char c) {