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:
Ivan Gerasimov 2019-04-09 16:32:22 -07:00
parent 758f02e6cc
commit eebe346715
5 changed files with 83 additions and 19 deletions

View file

@ -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);
}
/**