提交 aaee3a0a 编写于 作者: M martin

6728229: (str) StringBuilder.append(CharSequence) does not throw IndexOutOfBoundsException

Summary: Major spec rework
Reviewed-by: alanb
上级 9d7df9ae
...@@ -42,7 +42,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -42,7 +42,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/** /**
* The value is used for character storage. * The value is used for character storage.
*/ */
char value[]; char[] value;
/** /**
* The count is the number of characters used. * The count is the number of characters used.
...@@ -333,8 +333,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -333,8 +333,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* <code>dst.length</code> * <code>dst.length</code>
* </ul> * </ul>
*/ */
public void getChars(int srcBegin, int srcEnd, char dst[], public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
int dstBegin)
{ {
if (srcBegin < 0) if (srcBegin < 0)
throw new StringIndexOutOfBoundsException(srcBegin); throw new StringIndexOutOfBoundsException(srcBegin);
...@@ -366,14 +365,14 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -366,14 +365,14 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends the string representation of the <code>Object</code> * Appends the string representation of the {@code Object} argument.
* argument.
* <p> * <p>
* The argument is converted to a string as if by the method * The overall effect is exactly as if the argument were converted
* <code>String.valueOf</code>, and the characters of that * to a string by the method {@link String#valueOf(Object)},
* string are then appended to this sequence. * and the characters of that string were then
* {@link #append(String) appended} to this character sequence.
* *
* @param obj an <code>Object</code>. * @param obj an {@code Object}.
* @return a reference to this object. * @return a reference to this object.
*/ */
public AbstractStringBuilder append(Object obj) { public AbstractStringBuilder append(Object obj) {
...@@ -383,17 +382,17 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -383,17 +382,17 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/** /**
* Appends the specified string to this character sequence. * Appends the specified string to this character sequence.
* <p> * <p>
* The characters of the <code>String</code> argument are appended, in * The characters of the {@code String} argument are appended, in
* order, increasing the length of this sequence by the length of the * order, increasing the length of this sequence by the length of the
* argument. If <code>str</code> is <code>null</code>, then the four * argument. If {@code str} is {@code null}, then the four
* characters <code>"null"</code> are appended. * characters {@code "null"} are appended.
* <p> * <p>
* Let <i>n</i> be the length of this character sequence just prior to * Let <i>n</i> be the length of this character sequence just prior to
* execution of the <code>append</code> method. Then the character at * execution of the {@code append} method. Then the character at
* index <i>k</i> in the new character sequence is equal to the character * index <i>k</i> in the new character sequence is equal to the character
* at index <i>k</i> in the old character sequence, if <i>k</i> is less * at index <i>k</i> in the old character sequence, if <i>k</i> is less
* than <i>n</i>; otherwise, it is equal to the character at index * than <i>n</i>; otherwise, it is equal to the character at index
* <i>k-n</i> in the argument <code>str</code>. * <i>k-n</i> in the argument {@code str}.
* *
* @param str a string. * @param str a string.
* @return a reference to this object. * @return a reference to this object.
...@@ -435,33 +434,33 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -435,33 +434,33 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends a subsequence of the specified <code>CharSequence</code> to this * Appends a subsequence of the specified {@code CharSequence} to this
* sequence. * sequence.
* <p> * <p>
* Characters of the argument <code>s</code>, starting at * Characters of the argument {@code s}, starting at
* index <code>start</code>, are appended, in order, to the contents of * index {@code start}, are appended, in order, to the contents of
* this sequence up to the (exclusive) index <code>end</code>. The length * this sequence up to the (exclusive) index {@code end}. The length
* of this sequence is increased by the value of <code>end - start</code>. * of this sequence is increased by the value of {@code end - start}.
* <p> * <p>
* Let <i>n</i> be the length of this character sequence just prior to * Let <i>n</i> be the length of this character sequence just prior to
* execution of the <code>append</code> method. Then the character at * execution of the {@code append} method. Then the character at
* index <i>k</i> in this character sequence becomes equal to the * index <i>k</i> in this character sequence becomes equal to the
* character at index <i>k</i> in this sequence, if <i>k</i> is less than * character at index <i>k</i> in this sequence, if <i>k</i> is less than
* <i>n</i>; otherwise, it is equal to the character at index * <i>n</i>; otherwise, it is equal to the character at index
* <i>k+start-n</i> in the argument <code>s</code>. * <i>k+start-n</i> in the argument {@code s}.
* <p> * <p>
* If <code>s</code> is <code>null</code>, then this method appends * If {@code s} is {@code null}, then this method appends
* characters as if the s parameter was a sequence containing the four * characters as if the s parameter was a sequence containing the four
* characters <code>"null"</code>. * characters {@code "null"}.
* *
* @param s the sequence to append. * @param s the sequence to append.
* @param start the starting index of the subsequence to be appended. * @param start the starting index of the subsequence to be appended.
* @param end the end index of the subsequence to be appended. * @param end the end index of the subsequence to be appended.
* @return a reference to this object. * @return a reference to this object.
* @throws IndexOutOfBoundsException if * @throws IndexOutOfBoundsException if
* <code>start</code> or <code>end</code> are negative, or * {@code start} is negative, or
* <code>start</code> is greater than <code>end</code> or * {@code start} is greater than {@code end} or
* <code>end</code> is greater than <code>s.length()</code> * {@code end} is greater than {@code s.length()}
*/ */
public AbstractStringBuilder append(CharSequence s, int start, int end) { public AbstractStringBuilder append(CharSequence s, int start, int end) {
if (s == null) if (s == null)
...@@ -483,22 +482,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -483,22 +482,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends the string representation of the <code>char</code> array * Appends the string representation of the {@code char} array
* argument to this sequence. * argument to this sequence.
* <p> * <p>
* The characters of the array argument are appended, in order, to * The characters of the array argument are appended, in order, to
* the contents of this sequence. The length of this sequence * the contents of this sequence. The length of this sequence
* increases by the length of the argument. * increases by the length of the argument.
* <p> * <p>
* The overall effect is exactly as if the argument were converted to * The overall effect is exactly as if the argument were converted
* a string by the method {@link String#valueOf(char[])} and the * to a string by the method {@link String#valueOf(char[])},
* characters of that string were then {@link #append(String) appended} * and the characters of that string were then
* to this character sequence. * {@link #append(String) appended} to this character sequence.
* *
* @param str the characters to be appended. * @param str the characters to be appended.
* @return a reference to this object. * @return a reference to this object.
*/ */
public AbstractStringBuilder append(char str[]) { public AbstractStringBuilder append(char[] str) {
int newCount = count + str.length; int newCount = count + str.length;
if (newCount > value.length) if (newCount > value.length)
expandCapacity(newCount); expandCapacity(newCount);
...@@ -509,22 +508,25 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -509,22 +508,25 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/** /**
* Appends the string representation of a subarray of the * Appends the string representation of a subarray of the
* <code>char</code> array argument to this sequence. * {@code char} array argument to this sequence.
* <p> * <p>
* Characters of the <code>char</code> array <code>str</code>, starting at * Characters of the {@code char} array {@code str}, starting at
* index <code>offset</code>, are appended, in order, to the contents * index {@code offset}, are appended, in order, to the contents
* of this sequence. The length of this sequence increases * of this sequence. The length of this sequence increases
* by the value of <code>len</code>. * by the value of {@code len}.
* <p> * <p>
* The overall effect is exactly as if the arguments were converted to * The overall effect is exactly as if the arguments were converted
* a string by the method {@link String#valueOf(char[],int,int)} and the * to a string by the method {@link String#valueOf(char[],int,int)},
* characters of that string were then {@link #append(String) appended} * and the characters of that string were then
* to this character sequence. * {@link #append(String) appended} to this character sequence.
* *
* @param str the characters to be appended. * @param str the characters to be appended.
* @param offset the index of the first <code>char</code> to append. * @param offset the index of the first {@code char} to append.
* @param len the number of <code>char</code>s to append. * @param len the number of {@code char}s to append.
* @return a reference to this object. * @return a reference to this object.
* @throws IndexOutOfBoundsException
* if {@code offset < 0} or {@code len < 0}
* or {@code offset+len > str.length}
*/ */
public AbstractStringBuilder append(char str[], int offset, int len) { public AbstractStringBuilder append(char str[], int offset, int len) {
int newCount = count + len; int newCount = count + len;
...@@ -536,14 +538,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -536,14 +538,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends the string representation of the <code>boolean</code> * Appends the string representation of the {@code boolean}
* argument to the sequence. * argument to the sequence.
* <p> * <p>
* The argument is converted to a string as if by the method * The overall effect is exactly as if the argument were converted
* <code>String.valueOf</code>, and the characters of that * to a string by the method {@link String#valueOf(boolean)},
* string are then appended to this sequence. * and the characters of that string were then
* {@link #append(String) appended} to this character sequence.
* *
* @param b a <code>boolean</code>. * @param b a {@code boolean}.
* @return a reference to this object. * @return a reference to this object.
*/ */
public AbstractStringBuilder append(boolean b) { public AbstractStringBuilder append(boolean b) {
...@@ -569,18 +572,18 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -569,18 +572,18 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends the string representation of the <code>char</code> * Appends the string representation of the {@code char}
* argument to this sequence. * argument to this sequence.
* <p> * <p>
* The argument is appended to the contents of this sequence. * The argument is appended to the contents of this sequence.
* The length of this sequence increases by <code>1</code>. * The length of this sequence increases by {@code 1}.
* <p> * <p>
* The overall effect is exactly as if the argument were converted to * The overall effect is exactly as if the argument were converted
* a string by the method {@link String#valueOf(char)} and the character * to a string by the method {@link String#valueOf(char)},
* in that string were then {@link #append(String) appended} to this * and the character in that string were then
* character sequence. * {@link #append(String) appended} to this character sequence.
* *
* @param c a <code>char</code>. * @param c a {@code char}.
* @return a reference to this object. * @return a reference to this object.
*/ */
public AbstractStringBuilder append(char c) { public AbstractStringBuilder append(char c) {
...@@ -592,14 +595,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -592,14 +595,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends the string representation of the <code>int</code> * Appends the string representation of the {@code int}
* argument to this sequence. * argument to this sequence.
* <p> * <p>
* The argument is converted to a string as if by the method * The overall effect is exactly as if the argument were converted
* <code>String.valueOf</code>, and the characters of that * to a string by the method {@link String#valueOf(int)},
* string are then appended to this sequence. * and the characters of that string were then
* {@link #append(String) appended} to this character sequence.
* *
* @param i an <code>int</code>. * @param i an {@code int}.
* @return a reference to this object. * @return a reference to this object.
*/ */
public AbstractStringBuilder append(int i) { public AbstractStringBuilder append(int i) {
...@@ -618,14 +622,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -618,14 +622,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends the string representation of the <code>long</code> * Appends the string representation of the {@code long}
* argument to this sequence. * argument to this sequence.
* <p> * <p>
* The argument is converted to a string as if by the method * The overall effect is exactly as if the argument were converted
* <code>String.valueOf</code>, and the characters of that * to a string by the method {@link String#valueOf(long)},
* string are then appended to this sequence. * and the characters of that string were then
* {@link #append(String) appended} to this character sequence.
* *
* @param l a <code>long</code>. * @param l a {@code long}.
* @return a reference to this object. * @return a reference to this object.
*/ */
public AbstractStringBuilder append(long l) { public AbstractStringBuilder append(long l) {
...@@ -644,14 +649,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -644,14 +649,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends the string representation of the <code>float</code> * Appends the string representation of the {@code float}
* argument to this sequence. * argument to this sequence.
* <p> * <p>
* The argument is converted to a string as if by the method * The overall effect is exactly as if the argument were converted
* <code>String.valueOf</code>, and the characters of that * to a string by the method {@link String#valueOf(float)},
* string are then appended to this string sequence. * and the characters of that string were then
* {@link #append(String) appended} to this character sequence.
* *
* @param f a <code>float</code>. * @param f a {@code float}.
* @return a reference to this object. * @return a reference to this object.
*/ */
public AbstractStringBuilder append(float f) { public AbstractStringBuilder append(float f) {
...@@ -660,14 +666,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -660,14 +666,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends the string representation of the <code>double</code> * Appends the string representation of the {@code double}
* argument to this sequence. * argument to this sequence.
* <p> * <p>
* The argument is converted to a string as if by the method * The overall effect is exactly as if the argument were converted
* <code>String.valueOf</code>, and the characters of that * to a string by the method {@link String#valueOf(double)},
* string are then appended to this sequence. * and the characters of that string were then
* {@link #append(String) appended} to this character sequence.
* *
* @param d a <code>double</code>. * @param d a {@code double}.
* @return a reference to this object. * @return a reference to this object.
*/ */
public AbstractStringBuilder append(double d) { public AbstractStringBuilder append(double d) {
...@@ -677,17 +684,17 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -677,17 +684,17 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/** /**
* Removes the characters in a substring of this sequence. * Removes the characters in a substring of this sequence.
* The substring begins at the specified <code>start</code> and extends to * The substring begins at the specified {@code start} and extends to
* the character at index <code>end - 1</code> or to the end of the * the character at index {@code end - 1} or to the end of the
* sequence if no such character exists. If * sequence if no such character exists. If
* <code>start</code> is equal to <code>end</code>, no changes are made. * {@code start} is equal to {@code end}, no changes are made.
* *
* @param start The beginning index, inclusive. * @param start The beginning index, inclusive.
* @param end The ending index, exclusive. * @param end The ending index, exclusive.
* @return This object. * @return This object.
* @throws StringIndexOutOfBoundsException if <code>start</code> * @throws StringIndexOutOfBoundsException if {@code start}
* is negative, greater than <code>length()</code>, or * is negative, greater than {@code length()}, or
* greater than <code>end</code>. * greater than {@code end}.
*/ */
public AbstractStringBuilder delete(int start, int end) { public AbstractStringBuilder delete(int start, int end) {
if (start < 0) if (start < 0)
...@@ -705,7 +712,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -705,7 +712,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Appends the string representation of the <code>codePoint</code> * Appends the string representation of the {@code codePoint}
* argument to this sequence. * argument to this sequence.
* *
* <p> The argument is appended to the contents of this sequence. * <p> The argument is appended to the contents of this sequence.
...@@ -713,15 +720,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -713,15 +720,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* {@link Character#charCount(int) Character.charCount(codePoint)}. * {@link Character#charCount(int) Character.charCount(codePoint)}.
* *
* <p> The overall effect is exactly as if the argument were * <p> The overall effect is exactly as if the argument were
* converted to a <code>char</code> array by the method {@link * converted to a {@code char} array by the method
* Character#toChars(int)} and the character in that array were * {@link Character#toChars(int)} and the character in that array
* then {@link #append(char[]) appended} to this character * were then {@link #append(char[]) appended} to this character
* sequence. * sequence.
* *
* @param codePoint a Unicode code point * @param codePoint a Unicode code point
* @return a reference to this object. * @return a reference to this object.
* @exception IllegalArgumentException if the specified * @exception IllegalArgumentException if the specified
* <code>codePoint</code> isn't a valid Unicode code point * {@code codePoint} isn't a valid Unicode code point
*/ */
public AbstractStringBuilder appendCodePoint(int codePoint) { public AbstractStringBuilder appendCodePoint(int codePoint) {
if (!Character.isValidCodePoint(codePoint)) { if (!Character.isValidCodePoint(codePoint)) {
...@@ -879,27 +886,27 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -879,27 +886,27 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the string representation of a subarray of the <code>str</code> * Inserts the string representation of a subarray of the {@code str}
* array argument into this sequence. The subarray begins at the * array argument into this sequence. The subarray begins at the
* specified <code>offset</code> and extends <code>len</code> <code>char</code>s. * specified {@code offset} and extends {@code len} {@code char}s.
* The characters of the subarray are inserted into this sequence at * The characters of the subarray are inserted into this sequence at
* the position indicated by <code>index</code>. The length of this * the position indicated by {@code index}. The length of this
* sequence increases by <code>len</code> <code>char</code>s. * sequence increases by {@code len} {@code char}s.
* *
* @param index position at which to insert subarray. * @param index position at which to insert subarray.
* @param str A <code>char</code> array. * @param str A {@code char} array.
* @param offset the index of the first <code>char</code> in subarray to * @param offset the index of the first {@code char} in subarray to
* be inserted. * be inserted.
* @param len the number of <code>char</code>s in the subarray to * @param len the number of {@code char}s in the subarray to
* be inserted. * be inserted.
* @return This object * @return This object
* @throws StringIndexOutOfBoundsException if <code>index</code> * @throws StringIndexOutOfBoundsException if {@code index}
* is negative or greater than <code>length()</code>, or * is negative or greater than {@code length()}, or
* <code>offset</code> or <code>len</code> are negative, or * {@code offset} or {@code len} are negative, or
* <code>(offset+len)</code> is greater than * {@code (offset+len)} is greater than
* <code>str.length</code>. * {@code str.length}.
*/ */
public AbstractStringBuilder insert(int index, char str[], int offset, public AbstractStringBuilder insert(int index, char[] str, int offset,
int len) int len)
{ {
if ((index < 0) || (index > length())) if ((index < 0) || (index > length()))
...@@ -918,20 +925,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -918,20 +925,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the string representation of the <code>Object</code> * Inserts the string representation of the {@code Object}
* argument into this character sequence. * argument into this character sequence.
* <p> * <p>
* The second argument is converted to a string as if by the method * The overall effect is exactly as if the second argument were
* <code>String.valueOf</code>, and the characters of that * converted to a string by the method {@link String#valueOf(Object)},
* string are then inserted into this sequence at the indicated * and the characters of that string were then
* offset. * {@link #insert(int,String) inserted} into this character
* sequence at the indicated offset.
* <p> * <p>
* The offset argument must be greater than or equal to * The {@code offset} argument must be greater than or equal to
* <code>0</code>, and less than or equal to the length of this * {@code 0}, and less than or equal to the {@linkplain #length() length}
* sequence. * of this sequence.
* *
* @param offset the offset. * @param offset the offset.
* @param obj an <code>Object</code>. * @param obj an {@code Object}.
* @return a reference to this object. * @return a reference to this object.
* @throws StringIndexOutOfBoundsException if the offset is invalid. * @throws StringIndexOutOfBoundsException if the offset is invalid.
*/ */
...@@ -942,28 +950,28 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -942,28 +950,28 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/** /**
* Inserts the string into this character sequence. * Inserts the string into this character sequence.
* <p> * <p>
* The characters of the <code>String</code> argument are inserted, in * The characters of the {@code String} argument are inserted, in
* order, into this sequence at the indicated offset, moving up any * order, into this sequence at the indicated offset, moving up any
* characters originally above that position and increasing the length * characters originally above that position and increasing the length
* of this sequence by the length of the argument. If * of this sequence by the length of the argument. If
* <code>str</code> is <code>null</code>, then the four characters * {@code str} is {@code null}, then the four characters
* <code>"null"</code> are inserted into this sequence. * {@code "null"} are inserted into this sequence.
* <p> * <p>
* The character at index <i>k</i> in the new character sequence is * The character at index <i>k</i> in the new character sequence is
* equal to: * equal to:
* <ul> * <ul>
* <li>the character at index <i>k</i> in the old character sequence, if * <li>the character at index <i>k</i> in the old character sequence, if
* <i>k</i> is less than <code>offset</code> * <i>k</i> is less than {@code offset}
* <li>the character at index <i>k</i><code>-offset</code> in the * <li>the character at index <i>k</i>{@code -offset} in the
* argument <code>str</code>, if <i>k</i> is not less than * argument {@code str}, if <i>k</i> is not less than
* <code>offset</code> but is less than <code>offset+str.length()</code> * {@code offset} but is less than {@code offset+str.length()}
* <li>the character at index <i>k</i><code>-str.length()</code> in the * <li>the character at index <i>k</i>{@code -str.length()} in the
* old character sequence, if <i>k</i> is not less than * old character sequence, if <i>k</i> is not less than
* <code>offset+str.length()</code> * {@code offset+str.length()}
* </ul><p> * </ul><p>
* The offset argument must be greater than or equal to * The {@code offset} argument must be greater than or equal to
* <code>0</code>, and less than or equal to the length of this * {@code 0}, and less than or equal to the {@linkplain #length() length}
* sequence. * of this sequence.
* *
* @param offset the offset. * @param offset the offset.
* @param str a string. * @param str a string.
...@@ -986,27 +994,30 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -986,27 +994,30 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the string representation of the <code>char</code> array * Inserts the string representation of the {@code char} array
* argument into this sequence. * argument into this sequence.
* <p> * <p>
* The characters of the array argument are inserted into the * The characters of the array argument are inserted into the
* contents of this sequence at the position indicated by * contents of this sequence at the position indicated by
* <code>offset</code>. The length of this sequence increases by * {@code offset}. The length of this sequence increases by
* the length of the argument. * the length of the argument.
* <p> * <p>
* The overall effect is exactly as if the argument were converted to * The overall effect is exactly as if the second argument were
* a string by the method {@link String#valueOf(char[])} and the * converted to a string by the method {@link String#valueOf(char[])},
* characters of that string were then * and the characters of that string were then
* {@link #insert(int,String) inserted} into this * {@link #insert(int,String) inserted} into this character
* character sequence at the position indicated by * sequence at the indicated offset.
* <code>offset</code>. * <p>
* The {@code offset} argument must be greater than or equal to
* {@code 0}, and less than or equal to the {@linkplain #length() length}
* of this sequence.
* *
* @param offset the offset. * @param offset the offset.
* @param str a character array. * @param str a character array.
* @return a reference to this object. * @return a reference to this object.
* @throws StringIndexOutOfBoundsException if the offset is invalid. * @throws StringIndexOutOfBoundsException if the offset is invalid.
*/ */
public AbstractStringBuilder insert(int offset, char str[]) { public AbstractStringBuilder insert(int offset, char[] str) {
if ((offset < 0) || (offset > length())) if ((offset < 0) || (offset > length()))
throw new StringIndexOutOfBoundsException(offset); throw new StringIndexOutOfBoundsException(offset);
int len = str.length; int len = str.length;
...@@ -1020,18 +1031,20 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -1020,18 +1031,20 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the specified <code>CharSequence</code> into this sequence. * Inserts the specified {@code CharSequence} into this sequence.
* <p> * <p>
* The characters of the <code>CharSequence</code> argument are inserted, * The characters of the {@code CharSequence} argument are inserted,
* in order, into this sequence at the indicated offset, moving up * in order, into this sequence at the indicated offset, moving up
* any characters originally above that position and increasing the length * any characters originally above that position and increasing the length
* of this sequence by the length of the argument s. * of this sequence by the length of the argument s.
* <p> * <p>
* The result of this method is exactly the same as if it were an * The result of this method is exactly the same as if it were an
* invocation of this object's insert(dstOffset, s, 0, s.length()) method. * invocation of this object's
* {@link #insert(int,CharSequence,int,int) insert}(dstOffset, s, 0, s.length())
* method.
* *
* <p>If <code>s</code> is <code>null</code>, then the four characters * <p>If {@code s} is {@code null}, then the four characters
* <code>"null"</code> are inserted into this sequence. * {@code "null"} are inserted into this sequence.
* *
* @param dstOffset the offset. * @param dstOffset the offset.
* @param s the sequence to be inserted * @param s the sequence to be inserted
...@@ -1047,51 +1060,51 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -1047,51 +1060,51 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts a subsequence of the specified <code>CharSequence</code> into * Inserts a subsequence of the specified {@code CharSequence} into
* this sequence. * this sequence.
* <p> * <p>
* The subsequence of the argument <code>s</code> specified by * The subsequence of the argument {@code s} specified by
* <code>start</code> and <code>end</code> are inserted, * {@code start} and {@code end} are inserted,
* in order, into this sequence at the specified destination offset, moving * in order, into this sequence at the specified destination offset, moving
* up any characters originally above that position. The length of this * up any characters originally above that position. The length of this
* sequence is increased by <code>end - start</code>. * sequence is increased by {@code end - start}.
* <p> * <p>
* The character at index <i>k</i> in this sequence becomes equal to: * The character at index <i>k</i> in this sequence becomes equal to:
* <ul> * <ul>
* <li>the character at index <i>k</i> in this sequence, if * <li>the character at index <i>k</i> in this sequence, if
* <i>k</i> is less than <code>dstOffset</code> * <i>k</i> is less than {@code dstOffset}
* <li>the character at index <i>k</i><code>+start-dstOffset</code> in * <li>the character at index <i>k</i>{@code +start-dstOffset} in
* the argument <code>s</code>, if <i>k</i> is greater than or equal to * the argument {@code s}, if <i>k</i> is greater than or equal to
* <code>dstOffset</code> but is less than <code>dstOffset+end-start</code> * {@code dstOffset} but is less than {@code dstOffset+end-start}
* <li>the character at index <i>k</i><code>-(end-start)</code> in this * <li>the character at index <i>k</i>{@code -(end-start)} in this
* sequence, if <i>k</i> is greater than or equal to * sequence, if <i>k</i> is greater than or equal to
* <code>dstOffset+end-start</code> * {@code dstOffset+end-start}
* </ul><p> * </ul><p>
* The dstOffset argument must be greater than or equal to * The {@code dstOffset} argument must be greater than or equal to
* <code>0</code>, and less than or equal to the length of this * {@code 0}, and less than or equal to the {@linkplain #length() length}
* sequence. * of this sequence.
* <p>The start argument must be nonnegative, and not greater than * <p>The start argument must be nonnegative, and not greater than
* <code>end</code>. * {@code end}.
* <p>The end argument must be greater than or equal to * <p>The end argument must be greater than or equal to
* <code>start</code>, and less than or equal to the length of s. * {@code start}, and less than or equal to the length of s.
* *
* <p>If <code>s</code> is <code>null</code>, then this method inserts * <p>If {@code s} is {@code null}, then this method inserts
* characters as if the s parameter was a sequence containing the four * characters as if the s parameter was a sequence containing the four
* characters <code>"null"</code>. * characters {@code "null"}.
* *
* @param dstOffset the offset in this sequence. * @param dstOffset the offset in this sequence.
* @param s the sequence to be inserted. * @param s the sequence to be inserted.
* @param start the starting index of the subsequence to be inserted. * @param start the starting index of the subsequence to be inserted.
* @param end the end index of the subsequence to be inserted. * @param end the end index of the subsequence to be inserted.
* @return a reference to this object. * @return a reference to this object.
* @throws IndexOutOfBoundsException if <code>dstOffset</code> * @throws IndexOutOfBoundsException if {@code dstOffset}
* is negative or greater than <code>this.length()</code>, or * is negative or greater than {@code this.length()}, or
* <code>start</code> or <code>end</code> are negative, or * {@code start} or {@code end} are negative, or
* <code>start</code> is greater than <code>end</code> or * {@code start} is greater than {@code end} or
* <code>end</code> is greater than <code>s.length()</code> * {@code end} is greater than {@code s.length()}
*/ */
public AbstractStringBuilder insert(int dstOffset, CharSequence s, public AbstractStringBuilder insert(int dstOffset, CharSequence s,
int start, int end) { int start, int end) {
if (s == null) if (s == null)
s = "null"; s = "null";
if ((dstOffset < 0) || (dstOffset > this.length())) if ((dstOffset < 0) || (dstOffset > this.length()))
...@@ -1115,20 +1128,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -1115,20 +1128,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the string representation of the <code>boolean</code> * Inserts the string representation of the {@code boolean}
* argument into this sequence. * argument into this sequence.
* <p> * <p>
* The second argument is converted to a string as if by the method * The overall effect is exactly as if the second argument were
* <code>String.valueOf</code>, and the characters of that * converted to a string by the method {@link String#valueOf(boolean)},
* string are then inserted into this sequence at the indicated * and the characters of that string were then
* offset. * {@link #insert(int,String) inserted} into this character
* sequence at the indicated offset.
* <p> * <p>
* The offset argument must be greater than or equal to * The {@code offset} argument must be greater than or equal to
* <code>0</code>, and less than or equal to the length of this * {@code 0}, and less than or equal to the {@linkplain #length() length}
* sequence. * of this sequence.
* *
* @param offset the offset. * @param offset the offset.
* @param b a <code>boolean</code>. * @param b a {@code boolean}.
* @return a reference to this object. * @return a reference to this object.
* @throws StringIndexOutOfBoundsException if the offset is invalid. * @throws StringIndexOutOfBoundsException if the offset is invalid.
*/ */
...@@ -1137,25 +1151,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -1137,25 +1151,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the string representation of the <code>char</code> * Inserts the string representation of the {@code char}
* argument into this sequence. * argument into this sequence.
* <p> * <p>
* The second argument is inserted into the contents of this sequence * The overall effect is exactly as if the second argument were
* at the position indicated by <code>offset</code>. The length * converted to a string by the method {@link String#valueOf(char)},
* of this sequence increases by one. * and the character in that string were then
* <p> * {@link #insert(int,String) inserted} into this character
* The overall effect is exactly as if the argument were converted to * sequence at the indicated offset.
* a string by the method {@link String#valueOf(char)} and the character
* in that string were then {@link #insert(int, String) inserted} into
* this character sequence at the position indicated by
* <code>offset</code>.
* <p> * <p>
* The offset argument must be greater than or equal to * The {@code offset} argument must be greater than or equal to
* <code>0</code>, and less than or equal to the length of this * {@code 0}, and less than or equal to the {@linkplain #length() length}
* sequence. * of this sequence.
* *
* @param offset the offset. * @param offset the offset.
* @param c a <code>char</code>. * @param c a {@code char}.
* @return a reference to this object. * @return a reference to this object.
* @throws IndexOutOfBoundsException if the offset is invalid. * @throws IndexOutOfBoundsException if the offset is invalid.
*/ */
...@@ -1170,20 +1180,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -1170,20 +1180,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the string representation of the second <code>int</code> * Inserts the string representation of the second {@code int}
* argument into this sequence. * argument into this sequence.
* <p> * <p>
* The second argument is converted to a string as if by the method * The overall effect is exactly as if the second argument were
* <code>String.valueOf</code>, and the characters of that * converted to a string by the method {@link String#valueOf(int)},
* string are then inserted into this sequence at the indicated * and the characters of that string were then
* offset. * {@link #insert(int,String) inserted} into this character
* sequence at the indicated offset.
* <p> * <p>
* The offset argument must be greater than or equal to * The {@code offset} argument must be greater than or equal to
* <code>0</code>, and less than or equal to the length of this * {@code 0}, and less than or equal to the {@linkplain #length() length}
* sequence. * of this sequence.
* *
* @param offset the offset. * @param offset the offset.
* @param i an <code>int</code>. * @param i an {@code int}.
* @return a reference to this object. * @return a reference to this object.
* @throws StringIndexOutOfBoundsException if the offset is invalid. * @throws StringIndexOutOfBoundsException if the offset is invalid.
*/ */
...@@ -1192,20 +1203,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -1192,20 +1203,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the string representation of the <code>long</code> * Inserts the string representation of the {@code long}
* argument into this sequence. * argument into this sequence.
* <p> * <p>
* The second argument is converted to a string as if by the method * The overall effect is exactly as if the second argument were
* <code>String.valueOf</code>, and the characters of that * converted to a string by the method {@link String#valueOf(long)},
* string are then inserted into this sequence at the position * and the characters of that string were then
* indicated by <code>offset</code>. * {@link #insert(int,String) inserted} into this character
* sequence at the indicated offset.
* <p> * <p>
* The offset argument must be greater than or equal to * The {@code offset} argument must be greater than or equal to
* <code>0</code>, and less than or equal to the length of this * {@code 0}, and less than or equal to the {@linkplain #length() length}
* sequence. * of this sequence.
* *
* @param offset the offset. * @param offset the offset.
* @param l a <code>long</code>. * @param l a {@code long}.
* @return a reference to this object. * @return a reference to this object.
* @throws StringIndexOutOfBoundsException if the offset is invalid. * @throws StringIndexOutOfBoundsException if the offset is invalid.
*/ */
...@@ -1214,20 +1226,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -1214,20 +1226,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the string representation of the <code>float</code> * Inserts the string representation of the {@code float}
* argument into this sequence. * argument into this sequence.
* <p> * <p>
* The second argument is converted to a string as if by the method * The overall effect is exactly as if the second argument were
* <code>String.valueOf</code>, and the characters of that * converted to a string by the method {@link String#valueOf(float)},
* string are then inserted into this sequence at the indicated * and the characters of that string were then
* offset. * {@link #insert(int,String) inserted} into this character
* sequence at the indicated offset.
* <p> * <p>
* The offset argument must be greater than or equal to * The {@code offset} argument must be greater than or equal to
* <code>0</code>, and less than or equal to the length of this * {@code 0}, and less than or equal to the {@linkplain #length() length}
* sequence. * of this sequence.
* *
* @param offset the offset. * @param offset the offset.
* @param f a <code>float</code>. * @param f a {@code float}.
* @return a reference to this object. * @return a reference to this object.
* @throws StringIndexOutOfBoundsException if the offset is invalid. * @throws StringIndexOutOfBoundsException if the offset is invalid.
*/ */
...@@ -1236,20 +1249,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { ...@@ -1236,20 +1249,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
} }
/** /**
* Inserts the string representation of the <code>double</code> * Inserts the string representation of the {@code double}
* argument into this sequence. * argument into this sequence.
* <p> * <p>
* The second argument is converted to a string as if by the method * The overall effect is exactly as if the second argument were
* <code>String.valueOf</code>, and the characters of that * converted to a string by the method {@link String#valueOf(double)},
* string are then inserted into this sequence at the indicated * and the characters of that string were then
* offset. * {@link #insert(int,String) inserted} into this character
* sequence at the indicated offset.
* <p> * <p>
* The offset argument must be greater than or equal to * The {@code offset} argument must be greater than or equal to
* <code>0</code>, and less than or equal to the length of this * {@code 0}, and less than or equal to the {@linkplain #length() length}
* sequence. * of this sequence.
* *
* @param offset the offset. * @param offset the offset.
* @param d a <code>double</code>. * @param d a {@code double}.
* @return a reference to this object. * @return a reference to this object.
* @throws StringIndexOutOfBoundsException if the offset is invalid. * @throws StringIndexOutOfBoundsException if the offset is invalid.
*/ */
......
...@@ -212,7 +212,7 @@ package java.lang; ...@@ -212,7 +212,7 @@ package java.lang;
* @throws NullPointerException {@inheritDoc} * @throws NullPointerException {@inheritDoc}
* @throws IndexOutOfBoundsException {@inheritDoc} * @throws IndexOutOfBoundsException {@inheritDoc}
*/ */
public synchronized void getChars(int srcBegin, int srcEnd, char dst[], public synchronized void getChars(int srcBegin, int srcEnd, char[] dst,
int dstBegin) int dstBegin)
{ {
super.getChars(srcBegin, srcEnd, dst, dstBegin); super.getChars(srcBegin, srcEnd, dst, dstBegin);
...@@ -228,10 +228,6 @@ package java.lang; ...@@ -228,10 +228,6 @@ package java.lang;
value[index] = ch; value[index] = ch;
} }
/**
* @see java.lang.String#valueOf(java.lang.Object)
* @see #append(java.lang.String)
*/
public synchronized StringBuffer append(Object obj) { public synchronized StringBuffer append(Object obj) {
super.append(String.valueOf(obj)); super.append(String.valueOf(obj));
return this; return this;
...@@ -314,20 +310,19 @@ package java.lang; ...@@ -314,20 +310,19 @@ package java.lang;
return this; return this;
} }
public synchronized StringBuffer append(char str[]) { public synchronized StringBuffer append(char[] str) {
super.append(str); super.append(str);
return this; return this;
} }
public synchronized StringBuffer append(char str[], int offset, int len) { /**
* @throws IndexOutOfBoundsException {@inheritDoc}
*/
public synchronized StringBuffer append(char[] str, int offset, int len) {
super.append(str, offset, len); super.append(str, offset, len);
return this; return this;
} }
/**
* @see java.lang.String#valueOf(boolean)
* @see #append(java.lang.String)
*/
public synchronized StringBuffer append(boolean b) { public synchronized StringBuffer append(boolean b) {
super.append(b); super.append(b);
return this; return this;
...@@ -338,10 +333,6 @@ package java.lang; ...@@ -338,10 +333,6 @@ package java.lang;
return this; return this;
} }
/**
* @see java.lang.String#valueOf(int)
* @see #append(java.lang.String)
*/
public synchronized StringBuffer append(int i) { public synchronized StringBuffer append(int i) {
super.append(i); super.append(i);
return this; return this;
...@@ -355,28 +346,16 @@ package java.lang; ...@@ -355,28 +346,16 @@ package java.lang;
return this; return this;
} }
/**
* @see java.lang.String#valueOf(long)
* @see #append(java.lang.String)
*/
public synchronized StringBuffer append(long lng) { public synchronized StringBuffer append(long lng) {
super.append(lng); super.append(lng);
return this; return this;
} }
/**
* @see java.lang.String#valueOf(float)
* @see #append(java.lang.String)
*/
public synchronized StringBuffer append(float f) { public synchronized StringBuffer append(float f) {
super.append(f); super.append(f);
return this; return this;
} }
/**
* @see java.lang.String#valueOf(double)
* @see #append(java.lang.String)
*/
public synchronized StringBuffer append(double d) { public synchronized StringBuffer append(double d) {
super.append(d); super.append(d);
return this; return this;
...@@ -437,7 +416,7 @@ package java.lang; ...@@ -437,7 +416,7 @@ package java.lang;
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @since 1.2 * @since 1.2
*/ */
public synchronized StringBuffer insert(int index, char str[], int offset, public synchronized StringBuffer insert(int index, char[] str, int offset,
int len) int len)
{ {
super.insert(index, str, offset, len); super.insert(index, str, offset, len);
...@@ -446,9 +425,6 @@ package java.lang; ...@@ -446,9 +425,6 @@ package java.lang;
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(java.lang.Object)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public synchronized StringBuffer insert(int offset, Object obj) { public synchronized StringBuffer insert(int offset, Object obj) {
super.insert(offset, String.valueOf(obj)); super.insert(offset, String.valueOf(obj));
...@@ -457,7 +433,6 @@ package java.lang; ...@@ -457,7 +433,6 @@ package java.lang;
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see #length()
*/ */
public synchronized StringBuffer insert(int offset, String str) { public synchronized StringBuffer insert(int offset, String str) {
super.insert(offset, str); super.insert(offset, str);
...@@ -467,7 +442,7 @@ package java.lang; ...@@ -467,7 +442,7 @@ package java.lang;
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
*/ */
public synchronized StringBuffer insert(int offset, char str[]) { public synchronized StringBuffer insert(int offset, char[] str) {
super.insert(offset, str); super.insert(offset, str);
return this; return this;
} }
...@@ -498,9 +473,6 @@ package java.lang; ...@@ -498,9 +473,6 @@ package java.lang;
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(boolean)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuffer insert(int offset, boolean b) { public StringBuffer insert(int offset, boolean b) {
return insert(offset, String.valueOf(b)); return insert(offset, String.valueOf(b));
...@@ -508,7 +480,6 @@ package java.lang; ...@@ -508,7 +480,6 @@ package java.lang;
/** /**
* @throws IndexOutOfBoundsException {@inheritDoc} * @throws IndexOutOfBoundsException {@inheritDoc}
* @see #length()
*/ */
public synchronized StringBuffer insert(int offset, char c) { public synchronized StringBuffer insert(int offset, char c) {
super.insert(offset, c); super.insert(offset, c);
...@@ -517,9 +488,6 @@ package java.lang; ...@@ -517,9 +488,6 @@ package java.lang;
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(int)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuffer insert(int offset, int i) { public StringBuffer insert(int offset, int i) {
return insert(offset, String.valueOf(i)); return insert(offset, String.valueOf(i));
...@@ -527,9 +495,6 @@ package java.lang; ...@@ -527,9 +495,6 @@ package java.lang;
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(long)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuffer insert(int offset, long l) { public StringBuffer insert(int offset, long l) {
return insert(offset, String.valueOf(l)); return insert(offset, String.valueOf(l));
...@@ -537,9 +502,6 @@ package java.lang; ...@@ -537,9 +502,6 @@ package java.lang;
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(float)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuffer insert(int offset, float f) { public StringBuffer insert(int offset, float f) {
return insert(offset, String.valueOf(f)); return insert(offset, String.valueOf(f));
...@@ -547,9 +509,6 @@ package java.lang; ...@@ -547,9 +509,6 @@ package java.lang;
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(double)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuffer insert(int offset, double d) { public StringBuffer insert(int offset, double d) {
return insert(offset, String.valueOf(d)); return insert(offset, String.valueOf(d));
......
...@@ -124,10 +124,6 @@ public final class StringBuilder ...@@ -124,10 +124,6 @@ public final class StringBuilder
append(seq); append(seq);
} }
/**
* @see java.lang.String#valueOf(java.lang.Object)
* @see #append(java.lang.String)
*/
public StringBuilder append(Object obj) { public StringBuilder append(Object obj) {
return append(String.valueOf(obj)); return append(String.valueOf(obj));
} }
...@@ -175,7 +171,6 @@ public final class StringBuilder ...@@ -175,7 +171,6 @@ public final class StringBuilder
} }
/** /**
* @throws IndexOutOfBoundsException {@inheritDoc}
*/ */
public StringBuilder append(CharSequence s) { public StringBuilder append(CharSequence s) {
if (s == null) if (s == null)
...@@ -197,20 +192,19 @@ public final class StringBuilder ...@@ -197,20 +192,19 @@ public final class StringBuilder
return this; return this;
} }
public StringBuilder append(char str[]) { public StringBuilder append(char[] str) {
super.append(str); super.append(str);
return this; return this;
} }
public StringBuilder append(char str[], int offset, int len) { /**
* @throws IndexOutOfBoundsException {@inheritDoc}
*/
public StringBuilder append(char[] str, int offset, int len) {
super.append(str, offset, len); super.append(str, offset, len);
return this; return this;
} }
/**
* @see java.lang.String#valueOf(boolean)
* @see #append(java.lang.String)
*/
public StringBuilder append(boolean b) { public StringBuilder append(boolean b) {
super.append(b); super.append(b);
return this; return this;
...@@ -221,37 +215,21 @@ public final class StringBuilder ...@@ -221,37 +215,21 @@ public final class StringBuilder
return this; return this;
} }
/**
* @see java.lang.String#valueOf(int)
* @see #append(java.lang.String)
*/
public StringBuilder append(int i) { public StringBuilder append(int i) {
super.append(i); super.append(i);
return this; return this;
} }
/**
* @see java.lang.String#valueOf(long)
* @see #append(java.lang.String)
*/
public StringBuilder append(long lng) { public StringBuilder append(long lng) {
super.append(lng); super.append(lng);
return this; return this;
} }
/**
* @see java.lang.String#valueOf(float)
* @see #append(java.lang.String)
*/
public StringBuilder append(float f) { public StringBuilder append(float f) {
super.append(f); super.append(f);
return this; return this;
} }
/**
* @see java.lang.String#valueOf(double)
* @see #append(java.lang.String)
*/
public StringBuilder append(double d) { public StringBuilder append(double d) {
super.append(d); super.append(d);
return this; return this;
...@@ -292,7 +270,7 @@ public final class StringBuilder ...@@ -292,7 +270,7 @@ public final class StringBuilder
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
*/ */
public StringBuilder insert(int index, char str[], int offset, public StringBuilder insert(int index, char[] str, int offset,
int len) int len)
{ {
super.insert(index, str, offset, len); super.insert(index, str, offset, len);
...@@ -301,9 +279,6 @@ public final class StringBuilder ...@@ -301,9 +279,6 @@ public final class StringBuilder
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(java.lang.Object)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuilder insert(int offset, Object obj) { public StringBuilder insert(int offset, Object obj) {
return insert(offset, String.valueOf(obj)); return insert(offset, String.valueOf(obj));
...@@ -311,7 +286,6 @@ public final class StringBuilder ...@@ -311,7 +286,6 @@ public final class StringBuilder
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see #length()
*/ */
public StringBuilder insert(int offset, String str) { public StringBuilder insert(int offset, String str) {
super.insert(offset, str); super.insert(offset, str);
...@@ -321,7 +295,7 @@ public final class StringBuilder ...@@ -321,7 +295,7 @@ public final class StringBuilder
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
*/ */
public StringBuilder insert(int offset, char str[]) { public StringBuilder insert(int offset, char[] str) {
super.insert(offset, str); super.insert(offset, str);
return this; return this;
} }
...@@ -349,9 +323,6 @@ public final class StringBuilder ...@@ -349,9 +323,6 @@ public final class StringBuilder
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(boolean)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuilder insert(int offset, boolean b) { public StringBuilder insert(int offset, boolean b) {
super.insert(offset, b); super.insert(offset, b);
...@@ -360,7 +331,6 @@ public final class StringBuilder ...@@ -360,7 +331,6 @@ public final class StringBuilder
/** /**
* @throws IndexOutOfBoundsException {@inheritDoc} * @throws IndexOutOfBoundsException {@inheritDoc}
* @see #length()
*/ */
public StringBuilder insert(int offset, char c) { public StringBuilder insert(int offset, char c) {
super.insert(offset, c); super.insert(offset, c);
...@@ -369,9 +339,6 @@ public final class StringBuilder ...@@ -369,9 +339,6 @@ public final class StringBuilder
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(int)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuilder insert(int offset, int i) { public StringBuilder insert(int offset, int i) {
return insert(offset, String.valueOf(i)); return insert(offset, String.valueOf(i));
...@@ -379,9 +346,6 @@ public final class StringBuilder ...@@ -379,9 +346,6 @@ public final class StringBuilder
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(long)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuilder insert(int offset, long l) { public StringBuilder insert(int offset, long l) {
return insert(offset, String.valueOf(l)); return insert(offset, String.valueOf(l));
...@@ -389,9 +353,6 @@ public final class StringBuilder ...@@ -389,9 +353,6 @@ public final class StringBuilder
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(float)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuilder insert(int offset, float f) { public StringBuilder insert(int offset, float f) {
return insert(offset, String.valueOf(f)); return insert(offset, String.valueOf(f));
...@@ -399,9 +360,6 @@ public final class StringBuilder ...@@ -399,9 +360,6 @@ public final class StringBuilder
/** /**
* @throws StringIndexOutOfBoundsException {@inheritDoc} * @throws StringIndexOutOfBoundsException {@inheritDoc}
* @see java.lang.String#valueOf(double)
* @see #insert(int, java.lang.String)
* @see #length()
*/ */
public StringBuilder insert(int offset, double d) { public StringBuilder insert(int offset, double d) {
return insert(offset, String.valueOf(d)); return insert(offset, String.valueOf(d));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册