mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +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
|
@ -148,8 +148,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
|
|||
*/
|
||||
@HotSpotIntrinsicCandidate
|
||||
public StringBuffer(String str) {
|
||||
super(str.coder(), str.length(), 16);
|
||||
append(str);
|
||||
super(str);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,8 +161,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
|
|||
* @since 1.5
|
||||
*/
|
||||
public StringBuffer(CharSequence seq) {
|
||||
super(String.LATIN1, seq.length(), 16);
|
||||
append(seq);
|
||||
super(seq);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue