summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-05-11 22:57:13 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-05-11 22:57:13 +0000
commitb81a06c356c75e29d45a61d12fd1d0e48f20c8eb (patch)
tree8be2d179a19f711255d01e2a59b1f55ac1ea2f00
parent70742595d9d38b01275887b893cc3e8c98b35772 (diff)
downloadclasspath-b81a06c356c75e29d45a61d12fd1d0e48f20c8eb.tar.gz
2008-05-11 Andrew John Hughes <gnu_andrew@member.fsf.org>
* gnu/java/lang/CPStringBuilder.java: (toString()): Fix comments to reflect copying changes. * vm/reference/gnu/java/lang/VMCPStringBuilder.java: (toString()): Likewise.
-rw-r--r--ChangeLog7
-rw-r--r--gnu/java/lang/CPStringBuilder.java4
-rw-r--r--vm/reference/gnu/java/lang/VMCPStringBuilder.java4
3 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index ede60fe12..4c6248794 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2008-05-11 Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * gnu/java/lang/CPStringBuilder.java:
+ (toString()): Fix comments to reflect copying changes.
+ * vm/reference/gnu/java/lang/VMCPStringBuilder.java:
+ (toString()): Likewise.
+
+2008-05-11 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
* NEWS:
Mention GMP and CPStringBuilder.
diff --git a/gnu/java/lang/CPStringBuilder.java b/gnu/java/lang/CPStringBuilder.java
index c2ca848f9..688f36dbc 100644
--- a/gnu/java/lang/CPStringBuilder.java
+++ b/gnu/java/lang/CPStringBuilder.java
@@ -1138,8 +1138,8 @@ public final class CPStringBuilder
/**
* 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 {@link #ensureCapacity(int)}).
*
* @return the characters in this StringBuilder
*/
diff --git a/vm/reference/gnu/java/lang/VMCPStringBuilder.java b/vm/reference/gnu/java/lang/VMCPStringBuilder.java
index aafac7f24..8e137cd3f 100644
--- a/vm/reference/gnu/java/lang/VMCPStringBuilder.java
+++ b/vm/reference/gnu/java/lang/VMCPStringBuilder.java
@@ -75,8 +75,8 @@ final class VMCPStringBuilder
/**
* 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.