Author: ilya
Date: 2007-04-30 08:07:52 -0400 (Mon, 30 Apr 2007)
New Revision: 76487
Modified:
branches/mainsoft/gh20/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
Log:
merged from revision 76446
Modified:
branches/mainsoft/gh20/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
===================================================================
---
branches/mainsoft/gh20/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
2007-04-30 11:02:24 UTC (rev 76486)
+++
branches/mainsoft/gh20/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
2007-04-30 12:07:52 UTC (rev 76487)
@@ -50,11 +50,16 @@
{
}
- public NameValueCollection (NameValueCollection col) : base
(col.HashCodeProvider,col.Comparer)
+ public NameValueCollection (NameValueCollection col ) : base
((col == null) ? null : col.HashCodeProvider,
+
(col == null) ? null : col.Comparer)
{
if (col==null)
+#if NET_2_0
throw new ArgumentNullException ("col");
- Add (col);
+#else
+ throw new NullReferenceException ();
+#endif
+ Add(col);
}
#if NET_2_0
@@ -67,7 +72,8 @@
}
public NameValueCollection (int capacity, NameValueCollection
col)
- : base (capacity, col.HashCodeProvider, col.Comparer)
+ : base (capacity, (col == null) ? null :
col.HashCodeProvider,
+ (col == null) ? null : col.Comparer)
{
Add (col);
}
@@ -201,7 +207,17 @@
if (cachedAll == null)
RefreshCachedAll ();
+#if NET_2_0
+ try {
+#endif
cachedAll.CopyTo (dest, index);
+#if NET_2_0
+ }
+ catch (ArrayTypeMismatchException)
+ {
+ throw new InvalidCastException();
+ }
+#endif
}
private void RefreshCachedAll ()
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches