Hi,
As reported by Edwin Steiner, StringBuilder used System.arraycopy
instead of VMSystem.arraycopy and that causes bootstrap issues. I
committed the attached patch to fix this.
Regards,
Jeroen
2006-04-28 Jeroen Frijters <[EMAIL PROTECTED]>
* java/lang/StringBuilder.java
(ensureCapacity, getChars, append(StringBuffer),
append(char[],int,int), delete, replace,
insert(int,char[],int,int),
insert(int,String), insert(int,char), trimToSize): Replaced
System.arraycopy calls with VMSystem.arraycopy.
Index: java/lang/StringBuilder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/StringBuilder.java,v
retrieving revision 1.7
diff -u -r1.7 StringBuilder.java
--- java/lang/StringBuilder.java 2 Mar 2006 20:18:44 -0000 1.7
+++ java/lang/StringBuilder.java 28 Apr 2006 06:45:22 -0000
@@ -206,7 +206,7 @@
int max = value.length * 2 + 2;
minimumCapacity = (minimumCapacity < max ? max : minimumCapacity);
char[] nb = new char[minimumCapacity];
- System.arraycopy(value, 0, nb, 0, count);
+ VMSystem.arraycopy(value, 0, nb, 0, count);
value = nb;
}
}
@@ -285,7 +285,7 @@
{
if (srcOffset < 0 || srcEnd > count || srcEnd < srcOffset)
throw new StringIndexOutOfBoundsException();
- System.arraycopy(value, srcOffset, dst, dstOffset, srcEnd - srcOffset);
+ VMSystem.arraycopy(value, srcOffset, dst, dstOffset, srcEnd - srcOffset);
}
/**
@@ -355,7 +355,7 @@
{
int len = stringBuffer.count;
ensureCapacity(count + len);
- System.arraycopy(stringBuffer.value, 0, value, count, len);
+ VMSystem.arraycopy(stringBuffer.value, 0, value, count, len);
count += len;
}
return this;
@@ -395,7 +395,7 @@
if (offset < 0 || count < 0 || offset > data.length - count)
throw new StringIndexOutOfBoundsException();
ensureCapacity(this.count + count);
- System.arraycopy(data, offset, value, this.count, count);
+ VMSystem.arraycopy(data, offset, value, this.count, count);
this.count += count;
return this;
}
@@ -558,7 +558,7 @@
// This will unshare if required.
ensureCapacity(count);
if (count - end != 0)
- System.arraycopy(value, end, value, start, count - end);
+ VMSystem.arraycopy(value, end, value, start, count - end);
count -= end - start;
return this;
}
@@ -599,7 +599,7 @@
ensureCapacity(count + delta);
if (delta != 0 && end < count)
- System.arraycopy(value, end, value, end + delta, count - end);
+ VMSystem.arraycopy(value, end, value, end + delta, count - end);
str.getChars(0, len, value, start);
count += delta;
@@ -677,8 +677,8 @@
|| str_offset < 0 || str_offset > str.length - len)
throw new StringIndexOutOfBoundsException();
ensureCapacity(count + len);
- System.arraycopy(value, offset, value, offset + len, count - offset);
- System.arraycopy(str, str_offset, value, offset, len);
+ VMSystem.arraycopy(value, offset, value, offset + len, count - offset);
+ VMSystem.arraycopy(str, str_offset, value, offset, len);
count += len;
return this;
}
@@ -717,7 +717,7 @@
str = "null";
int len = str.count;
ensureCapacity(count + len);
- System.arraycopy(value, offset, value, offset + len, count - offset);
+ VMSystem.arraycopy(value, offset, value, offset + len, count - offset);
str.getChars(0, len, value, offset);
count += len;
return this;
@@ -814,7 +814,7 @@
if (offset < 0 || offset > count)
throw new StringIndexOutOfBoundsException(offset);
ensureCapacity(count + 1);
- System.arraycopy(value, offset, value, offset + 1, count - offset);
+ VMSystem.arraycopy(value, offset, value, offset + 1, count - offset);
value[offset] = ch;
count++;
return this;
@@ -1063,7 +1063,7 @@
if (count < value.length)
{
char[] newValue = new char[count];
- System.arraycopy(value, 0, newValue, 0, count);
+ VMSystem.arraycopy(value, 0, newValue, 0, count);
value = newValue;
}
}