[Mono-bugs] [Bug 52740][Maj] New - Hashtable.Clone returns a HT with the wrong count

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 10 Jan 2004 14:05:25 -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=52740

--- shadow/52740	2004-01-10 14:05:25.000000000 -0500
+++ shadow/52740.tmp.763	2004-01-10 14:05:25.000000000 -0500
@@ -0,0 +1,43 @@
+Bug#: 52740
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Hashtable.Clone returns a HT with the wrong count
+
+using System;
+using System.Collections;
+
+class T {
+	static void Main ()
+	{
+		Hashtable ht1 = new Hashtable ();
+		ht1.Add (1, null);
+		
+		Hashtable ht2 = (Hashtable) ht1.Clone ();
+		
+		Console.WriteLine ("ht1: " + ht1.Count);
+		Console.WriteLine ("ht2: " + ht2.Count);
+		
+		if (ht1.Count != ht2.Count)
+			Console.WriteLine ("FAIL");
+	}
+}
+
+We print
+ht1: 1
+ht2: 2
+FAIL
+
+Ms is 1/1