This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: StringBuffer metafix


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;    

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]