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

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