< prev index next >

src/java.base/share/classes/java/lang/StringBuffer.java

Print this page

        

*** 146,156 **** * * @param str the initial contents of the buffer. */ @HotSpotIntrinsicCandidate public StringBuffer(String str) { ! super(str); } /** * Constructs a string buffer that contains the same characters * as the specified {@code CharSequence}. The initial capacity of --- 146,157 ---- * * @param str the initial contents of the buffer. */ @HotSpotIntrinsicCandidate public StringBuffer(String str) { ! super(str.coder(), str.length(), 16); ! append(str); } /** * Constructs a string buffer that contains the same characters * as the specified {@code CharSequence}. The initial capacity of
*** 159,169 **** * * @param seq the sequence to copy. * @since 1.5 */ public StringBuffer(CharSequence seq) { ! super(seq); } /** * Compares two {@code StringBuffer} instances lexicographically. This method * follows the same rules for lexicographical comparison as defined in the --- 160,171 ---- * * @param seq the sequence to copy. * @since 1.5 */ public StringBuffer(CharSequence seq) { ! super(String.LATIN1, seq.length(), 16); ! append(seq); } /** * Compares two {@code StringBuffer} instances lexicographically. This method * follows the same rules for lexicographical comparison as defined in the
< prev index next >