[Mono-bugs] [Bug 72244][Nor] Changed - new StringBuilder(4, 7).Append ("foo").Append ("bar");
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 5 Feb 2005 15:10:06 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by bmaurer@users.sf.net.
http://bugzilla.ximian.com/show_bug.cgi?id=72244
--- shadow/72244 2005-02-05 14:52:25.000000000 -0500
+++ shadow/72244.tmp.13800 2005-02-05 15:10:06.000000000 -0500
@@ -1,23 +1,23 @@
Bug#: 72244
Product: Mono: Class Libraries
Version: 1.1
-OS:
+OS: unknown
OS Details: Windows XP SP2
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Normal
Component: CORLIB
AssignedTo: mono-bugs@ximian.com
ReportedBy: gert.driesen@pandora.be
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
URL:
Cc:
-Summary: StringBuilder.ToString() changes capacity of StringBuilder
+Summary: new StringBuilder(4, 7).Append ("foo").Append ("bar");
Calling ToString() on a StringBuilder instance modifies the capacity of
that instance.
To reproduce this issue, compile and execute the following code snippet :
@@ -58,6 +58,23 @@
Expect Results (using MS.NET):
Capacity #1: 6
Capacity #2: 6
Capacity #3: 6
+
+------- Additional Comments From bmaurer@users.sf.net 2005-02-05 15:10 -------
+The resizing issue is NOTABUG. We are free to resize it if we want to
+(the Capacity is impl defined, according to msdn). However, this is a bug:
+
+using System;
+using System.Text;
+
+public class EntryPoint {
+ public static void Main() {
+ new StringBuilder(4, 7).Append ("foo").Append ("bar");
+ }
+}
+
+The issue is that we try to resize to capacity 8 on the second append
+(4*2 == 8). This is above the max capcity. However, we can stil resize
+to 6 or 7, and not be above, and still fit the string.