mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8221430: StringBuffer(CharSequence) constructor truncates when -XX:-CompactStrings specified
Co-authored-by: Andrew Leonard <andrew_m_leonard@uk.ibm.com> Reviewed-by: igerasim, rriggs
This commit is contained in:
parent
758f02e6cc
commit
eebe346715
5 changed files with 83 additions and 19 deletions
|
@ -121,8 +121,7 @@ public final class StringBuilder
|
|||
*/
|
||||
@HotSpotIntrinsicCandidate
|
||||
public StringBuilder(String str) {
|
||||
super(str.coder(), str.length(), 16);
|
||||
append(str);
|
||||
super(str);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -134,8 +133,7 @@ public final class StringBuilder
|
|||
* @param seq the sequence to copy.
|
||||
*/
|
||||
public StringBuilder(CharSequence seq) {
|
||||
super(String.LATIN1, seq.length(), 16);
|
||||
append(seq);
|
||||
super(seq);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue