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:
parent
ede1dbac05
commit
ac83e16bc4
@ -6,6 +6,8 @@
|
|||||||
(replace): Reimplemented. Fix javadoc.
|
(replace): Reimplemented. Fix javadoc.
|
||||||
(reverse): Call ensureCapacity_unsynchronized().
|
(reverse): Call ensureCapacity_unsynchronized().
|
||||||
(StringBuffer (String)): Use DEFAULT_CAPACITY.
|
(StringBuffer (String)): Use DEFAULT_CAPACITY.
|
||||||
|
|
||||||
|
(replace): Calculate length for arraycopy() correctly.
|
||||||
|
|
||||||
2000-05-09 Tom Tromey <tromey@cygnus.com>
|
2000-05-09 Tom Tromey <tromey@cygnus.com>
|
||||||
|
|
||||||
|
@ -519,7 +519,7 @@ public final class StringBuffer implements Serializable
|
|||||||
ensureCapacity_unsynchronized (count + delta);
|
ensureCapacity_unsynchronized (count + delta);
|
||||||
|
|
||||||
if (delta != 0 && end < count)
|
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);
|
str.getChars (0, len, value, start);
|
||||||
count += delta;
|
count += delta;
|
||||||
|
Loading…
Reference in New Issue
Block a user