[Mono-bugs] [Bug 61351][Nor] Changed - Hashtable.ContainsKey doesn't throw ArgumentNullException

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 9 Jul 2004 21:23:08 -0400 (EDT)


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 gonzalo@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=61351

--- shadow/61351	2004-07-09 12:09:03.000000000 -0400
+++ shadow/61351.tmp.29653	2004-07-09 21:23:08.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 61351
 Product: Mono: Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
-Status: NEW   
-Resolution: 
-Severity: 
+Status: RESOLVED   
+Resolution: NOTABUG
+Severity: Unknown
 Priority: Normal
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: mkestner@ximian.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -16,6 +16,31 @@
 Cc: 
 Summary: Hashtable.ContainsKey doesn't throw ArgumentNullException
 
 The MS runtime throws ArgumentNullException when a null key is passed to
 ContainsKey.  We need to do so also to avoid crashes on the MS runtime for
 code that works on mono.
+
+------- Additional Comments From gonzalo@ximian.com  2004-07-09 21:23 -------
+Compiling and running this program:
+---
+using System;
+using System.Collections;
+
+class C {
+        static void Main ()
+        {
+                Hashtable t = new Hashtable ();
+                t.ContainsKey (null);
+        }
+}
+---
+
+gives:
+gonzalo@k7:~/go-mono$ mono htnull.exe
+
+Unhandled Exception: System.ArgumentNullException: null key
+Parameter name: key
+in <0x0007e> System.Collections.Hashtable:Find (object)
+in <0x00012> System.Collections.Hashtable:Contains (object)
+in <0x0000f> System.Collections.Hashtable:ContainsKey (object)
+in <0x00036> C:Main ()