Patch: StringBuffer metafix

Bryce McKinlay bryce@albatross.co.nz
Wed May 10 04:15:00 GMT 2000


My previous patch contained an error. This patch fixes it.

regards

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

        * java/lang/StringBuffer.java (replace): Calculate length for
        arraycopy() correctly.
	
Index: StringBuffer.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/StringBuffer.java,v
retrieving revision 1.6
diff -u -r1.6 StringBuffer.java
--- StringBuffer.java	2000/05/10 10:15:13	1.6
+++ StringBuffer.java	2000/05/10 11:08:05
@@ -519,7 +519,7 @@
     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;    


More information about the Java-patches mailing list