318 * sequence. 319 * <p> 320 * The characters of the {@code CharSequence} argument are appended, 321 * in order, increasing the length of this sequence by the length of the 322 * argument. 323 * 324 * <p>The result of this method is exactly the same as if it were an 325 * invocation of this.append(s, 0, s.length()); 326 * 327 * <p>This method synchronizes on {@code this}, the destination 328 * object, but does not synchronize on the source ({@code s}). 329 * 330 * <p>If {@code s} is {@code null}, then the four characters 331 * {@code "null"} are appended. 332 * 333 * @param s the {@code CharSequence} to append. 334 * @return a reference to this object. 335 * @since 1.5 336 */ 337 @Override 338 public StringBuffer append(CharSequence s) { 339 // Note, synchronization achieved via invocations of other StringBuffer methods after 340 // narrowing of s to specific type 341 // Ditto for toStringCache clearing 342 super.append(s); 343 return this; 344 } 345 346 /** 347 * @throws IndexOutOfBoundsException {@inheritDoc} 348 * @since 1.5 349 */ 350 @Override 351 public synchronized StringBuffer append(CharSequence s, int start, int end) 352 { 353 toStringCache = null; 354 super.append(s, start, end); 355 return this; 356 } 357 358 @Override 359 public synchronized StringBuffer append(char[] str) { 360 toStringCache = null; 361 super.append(str); | 318 * sequence. 319 * <p> 320 * The characters of the {@code CharSequence} argument are appended, 321 * in order, increasing the length of this sequence by the length of the 322 * argument. 323 * 324 * <p>The result of this method is exactly the same as if it were an 325 * invocation of this.append(s, 0, s.length()); 326 * 327 * <p>This method synchronizes on {@code this}, the destination 328 * object, but does not synchronize on the source ({@code s}). 329 * 330 * <p>If {@code s} is {@code null}, then the four characters 331 * {@code "null"} are appended. 332 * 333 * @param s the {@code CharSequence} to append. 334 * @return a reference to this object. 335 * @since 1.5 336 */ 337 @Override 338 public synchronized StringBuffer append(CharSequence s) { 339 toStringCache = null; 340 super.append(s); 341 return this; 342 } 343 344 /** 345 * @throws IndexOutOfBoundsException {@inheritDoc} 346 * @since 1.5 347 */ 348 @Override 349 public synchronized StringBuffer append(CharSequence s, int start, int end) 350 { 351 toStringCache = null; 352 super.append(s, start, end); 353 return this; 354 } 355 356 @Override 357 public synchronized StringBuffer append(char[] str) { 358 toStringCache = null; 359 super.append(str); |