StringBuffer.java (replace): Calculate length for arraycopy() correctly.

2000-05-10  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/StringBuffer.java (replace): Calculate length for
	arraycopy() correctly.

From-SVN: r33822
This commit is contained in:
Bryce McKinlay 2000-05-10 11:13:17 +00:00 committed by Bryce McKinlay
parent ede1dbac05
commit ac83e16bc4
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,8 @@
(replace): Reimplemented. Fix javadoc.
(reverse): Call ensureCapacity_unsynchronized().
(StringBuffer (String)): Use DEFAULT_CAPACITY.
(replace): Calculate length for arraycopy() correctly.
2000-05-09 Tom Tromey <tromey@cygnus.com>

View File

@ -519,7 +519,7 @@ public final class StringBuffer implements Serializable
ensureCapacity_unsynchronized (count + delta);
if (delta != 0 && end < count)
System.arraycopy(value, end, value, end + delta, count - start);
System.arraycopy(value, end, value, end + delta, count - end);
str.getChars (0, len, value, start);
count += delta;