Prechádzať zdrojové kódy

2002-04-28 Duncan Mak <[email protected]>

	ArrayList.cs (InsertRange): Throw exceptions where needed.

svn path=/trunk/mcs/; revision=4124
Duncan Mak 24 rokov pred
rodič
commit
2db87b0f11

+ 10 - 0
mcs/class/corlib/System.Collections/ArrayList.cs

@@ -480,6 +480,16 @@ namespace System.Collections {
 
 		[MonoTODO]
 		public virtual void InsertRange (int index, ICollection c) {
+
+			if (c == null)
+				throw new ArgumentNullException ();
+
+			if (index < 0 || index > this.Count)
+				throw new ArgumentOutOfRangeException ();
+
+			if (IsReadOnly || IsFixedSize)
+				throw new NotSupportedException ();
+			
 			version++;
 		}
 

+ 4 - 0
mcs/class/corlib/System.Collections/ChangeLog

@@ -1,3 +1,7 @@
+2002-04-28  Duncan Mak  <[email protected]>
+
+	* ArrayList.cs (InsertRange): Throw exceptions where needed.
+
 2002-04-29  Nick Drochak  <[email protected]>
 
 	* Hashtable.cs (CopyTo): Throw exceptions where needed.