This fixes the inaccurate comment Tom pointed out,
which is also present in the VM version too.

ChangeLog:

2008-05-11  Andrew John Hughes  <[EMAIL PROTECTED]>

        * gnu/java/lang/CPStringBuilder.java:
        (toString()): Fix comments to reflect copying changes.
        * vm/reference/gnu/java/lang/VMCPStringBuilder.java:
        (toString()): Likewise.

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: gnu/java/lang/CPStringBuilder.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/java/lang/CPStringBuilder.java,v
retrieving revision 1.8
diff -u -r1.8 CPStringBuilder.java
--- gnu/java/lang/CPStringBuilder.java  11 May 2008 18:48:52 -0000      1.8
+++ gnu/java/lang/CPStringBuilder.java  11 May 2008 22:48:46 -0000
@@ -1138,8 +1138,8 @@
   /**
    * Convert this <code>CPStringBuilder</code> to a <code>String</code>. The
    * String is composed of the characters currently in this StringBuilder. Note
-   * that the result is not a copy, so future modifications to this buffer
-   * do affect the String.
+   * that the result is not a copy, so we flag this here and make sure to
+   * allocate a new array on the next write attempt (see [EMAIL PROTECTED] 
#ensureCapacity(int)}).
    *
    * @return the characters in this StringBuilder
    */
Index: vm/reference/gnu/java/lang/VMCPStringBuilder.java
===================================================================
RCS file: 
/sources/classpath/classpath/vm/reference/gnu/java/lang/VMCPStringBuilder.java,v
retrieving revision 1.2
diff -u -r1.2 VMCPStringBuilder.java
--- vm/reference/gnu/java/lang/VMCPStringBuilder.java   9 May 2008 23:30:41 
-0000       1.2
+++ vm/reference/gnu/java/lang/VMCPStringBuilder.java   11 May 2008 22:48:55 
-0000
@@ -75,8 +75,8 @@
   /**
    * Convert this <code>StringBuilder</code> to a <code>String</code>. The
    * String is composed of the characters currently in this StringBuilder. Note
-   * that the result is not a copy, so future modifications to this buffer
-   * do affect the String.
+   * that the result is not a copy, so the builder will allocate a new array
+   * if a further write operation is attempted.
    *
    * @param value the buffered characters.
    * @param startIndex the index at which to start taking characters from the 
buffer.

Reply via email to