mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-04 15:41:21 +08:00
* gnu/gcj/runtime/StringBuffer.java
(ensureCapacity_unsynchronized): Ensure we always get at least `minimumCapacity' characters in new buffer. From-SVN: r47940
This commit is contained in:
parent
dc5c569ae3
commit
a46ce590a8
@ -1,3 +1,9 @@
|
||||
2001-12-12 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* gnu/gcj/runtime/StringBuffer.java
|
||||
(ensureCapacity_unsynchronized): Ensure we always get at least
|
||||
`minimumCapacity' characters in new buffer.
|
||||
|
||||
2001-12-11 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* java/lang/String.java (String): New constructor.
|
||||
|
@ -130,7 +130,7 @@ public final class StringBuffer
|
||||
{
|
||||
if (minimumCapacity > value.length)
|
||||
{
|
||||
minimumCapacity = value.length * 2 + 2;
|
||||
minimumCapacity = Math.max (minimumCapacity, value.length * 2 + 2);
|
||||
char[] nb = new char[minimumCapacity];
|
||||
System.arraycopy(value, 0, nb, 0, count);
|
||||
value = nb;
|
||||
|
Loading…
x
Reference in New Issue
Block a user