mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8325590: Regression in round-tripping UTF-16 strings after JDK-8311906
Reviewed-by: alanb, redestad
This commit is contained in:
parent
57b04e1b5d
commit
13d9e8ff38
2 changed files with 37 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -841,7 +841,7 @@ public final class String
|
|||
}
|
||||
if (COMPACT_STRINGS) {
|
||||
byte[] val = StringUTF16.compress(ca, 0, caLen);
|
||||
int coder = StringUTF16.coderFromArrayLen(val, len);
|
||||
byte coder = StringUTF16.coderFromArrayLen(val, caLen);
|
||||
return new String(val, coder);
|
||||
}
|
||||
return new String(StringUTF16.toBytes(ca, 0, caLen), UTF16);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue