(RegisterObject): Throw ArgumentOutOfRangeException if the objectID
authorDuncan Mak <duncan@mono-cvs.ximian.com>
Tue, 8 Jun 2004 18:39:04 +0000 (18:39 -0000)
committerDuncan Mak <duncan@mono-cvs.ximian.com>
Tue, 8 Jun 2004 18:39:04 +0000 (18:39 -0000)
parameter is less than or equal to zero. This check was missing from
this particular overload.

svn path=/trunk/mcs/; revision=29053

mcs/class/corlib/System.Runtime.Serialization/ChangeLog
mcs/class/corlib/System.Runtime.Serialization/ObjectManager.cs

index fa1184f4c1a5ef60d37f4e3f9aa00707fa95b92c..828595318064810559f2b51fc8875820d9a0b439 100644 (file)
@@ -1,3 +1,10 @@
+2004-06-08  Duncan Mak  <duncan@ximian.com>
+
+       * ObjectManager.cs (RegisterObject): Throw
+       ArgumentOutOfRangeException if the objectID parameter is less than
+       or equal to zero. This check was missing from this particular
+       overload.
+
 2004-05-14  Marek Safar  <marek.safar@seznam.cz>
 
        * SerializationInfo.cs: Removed useless [CLSCompliant (false)]
index 0c62cff86cac3e1497b13558af7b9d644e775bba..5854d29007a2721b6ca578916573d68bf17f7979 100644 (file)
@@ -1,11 +1,11 @@
-//
-// System.Runtime.Serialization.ObjectManager.cs
-//
-// Author: Lluis Sanchez Gual (lluis@ideary.com)
-//
-// (C) 2003 Lluis Sanchez Gual
-//
-
+//\r
+// System.Runtime.Serialization.ObjectManager.cs\r
+//\r
+// Author: Lluis Sanchez Gual (lluis@ideary.com)\r
+//\r
+// (C) 2003 Lluis Sanchez Gual\r
+//\r
+\r
 using System;\r
 using System.Collections;\r
 using System.Reflection;\r
@@ -206,13 +206,14 @@ namespace System.Runtime.Serialization
 \r
                public virtual void RegisterObject (object obj, long objectID)\r
                {\r
+                       if (objectID <= 0) throw new ArgumentOutOfRangeException("objectID","The objectID parameter is less than or equal to zero");\r
                        RegisterObjectInternal (obj, GetObjectRecord (objectID));\r
                }\r
 \r
                public void RegisterObject (object obj, long objectID, SerializationInfo info)\r
                {\r
                        if (objectID <= 0) throw new ArgumentOutOfRangeException("objectID","The objectID parameter is less than or equal to zero");\r
-\r
+                       \r
                        ObjectRecord record = GetObjectRecord (objectID);\r
                        record.Info = info;\r
                        RegisterObjectInternal (obj, record);\r