2001-11-14 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Wed, 14 Nov 2001 20:35:42 +0000 (20:35 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 14 Nov 2001 20:35:42 +0000 (20:35 -0000)
* Decimal.cs, Double.cs, Byte.cs, Char.cs, Int16, UInt16, Int32,
UInt32, Int64, UInt64, SByte, Single (CompareTo): Throw the
exception if the value is null too.

* Char.cs (CompareTo): ditto.

* ApplicationException.cs: Added constructor that does serialization.

* ParamArrayAttribute.cs: Define attribute correctly.

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

16 files changed:
mcs/class/corlib/System/AppDomain.cs
mcs/class/corlib/System/ApplicationException.cs
mcs/class/corlib/System/Byte.cs
mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/Char.cs
mcs/class/corlib/System/Decimal.cs
mcs/class/corlib/System/Double.cs
mcs/class/corlib/System/Int16.cs
mcs/class/corlib/System/Int32.cs
mcs/class/corlib/System/Int64.cs
mcs/class/corlib/System/ParamArrayAttribute.cs
mcs/class/corlib/System/SByte.cs
mcs/class/corlib/System/Single.cs
mcs/class/corlib/System/UInt16.cs
mcs/class/corlib/System/UInt32.cs
mcs/class/corlib/System/UInt64.cs

index 43067ae463c35f1d35bf9f51f8964187046f54b1..c32871692ca5b9335199371547153f1b76208839 100755 (executable)
@@ -14,20 +14,27 @@ using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
 
 namespace System {
+
        public interface AppDomain_Intf {
        }
+
        public sealed class AppDomain /* : MarshalByRefObject , _AppDomain, IEvidenceFactory */ {
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private static extern AppDomain getCurDomain ();
                
-               public static AppDomain CurrentDomain {
-                       get { return getCurDomain ();}
+               public static AppDomain CurrentDomain
+               {
+                       get {
+                               return getCurDomain ();
+                       }
                }
-               public AssemblyBuilder DefineDynamicAssembly( AssemblyName name, AssemblyBuilderAccess access) {
+
+               public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
+                                                             AssemblyBuilderAccess access)
+               {
                        AssemblyBuilder ab = new AssemblyBuilder (name, access);
                        return ab;
                }
-
        }
 }
index 9bb597644aa9620aa26ce7826022f007f2649763..884b6b1a8c77db96b455e6fdcf2013c53c610d58 100644 (file)
@@ -1,12 +1,16 @@
 //
 // System.ApplicationException.cs
 //
-// Author:
+// Authors:
 //   Joe Shaw (joe@ximian.com)
+//   Miguel de Icaza (miguel@ximian.com) 
 //
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
 //
 
+using System.Runtime.Serialization;
+using System.Reflection;
+
 namespace System {
 
        public class ApplicationException : Exception {
@@ -25,5 +29,10 @@ namespace System {
                        : base (message, inner)
                {
                }
+
+               protected ApplicationException (SerializationInfo info, StreamingContext context)
+                       : base (info, context)
+               {
+               }
        }
 }
index 49f9d44edbb4b8669034c23b3baa3a313955bd00..c8c9e0bbc6a81ff2dc8a1c3ae54dddcd8b2e3fb0 100644 (file)
@@ -23,7 +23,7 @@ namespace System {
 
                public int CompareTo (object v)
                {
-                       if (!(v is System.Byte))
+                       if (v == null || !(v is System.Byte))
                                throw new ArgumentException ("Value is not a System.Byte");
 
                        return value - ((byte) v);
index 83fab8db9d1bd2f32a646615b0d897b38a52ae5e..b16f3b63a217830b0d30ccc1beb331435b795b0f 100644 (file)
@@ -1,3 +1,14 @@
+2001-11-14  Miguel de Icaza  <miguel@ximian.com>
+
+       * Decimal.cs, Double.cs, Byte.cs, Char.cs, Int16, UInt16, Int32,
+       UInt32, Int64, UInt64, SByte, Single (CompareTo): Throw the
+       exception if the value is null too.
+
+       * Char.cs (CompareTo): ditto.
+
+       * ApplicationException.cs: Added constructor that does serialization.
+
+       * ParamArrayAttribute.cs: Define attribute correctly.
 
 Wed Nov 14 16:31:19 CET 2001 Paolo Molaro <lupus@ximian.com>
 
index 5f9dea72347a13902e603256a08f384b7541c3bc..ad7228926ae3e098bee67a94bd56d100da6b8cc2 100644 (file)
@@ -28,7 +28,7 @@ namespace System {
                
                public int CompareTo (object v)
                {
-                       if (!(v is System.Char))
+                       if (v == null || !(v is System.Char))
                                throw new ArgumentException ("Value is not a System.Char");
 
                        return value - ((char) v);
index 606331110665b2a1dbd79c533b58483a16cd3e86..575601b9a84cd015a82a9f56c08a01f2da976117 100644 (file)
@@ -588,7 +588,7 @@ namespace System
 \r
         public int CompareTo(object val)\r
         {\r
-            if (!(val is Decimal))\r
+            if (val == null || !(val is Decimal))\r
                 throw new ArgumentException ("Value is not a System.Decimal");\r
 \r
             Decimal d2 = (Decimal)val;\r
index af193760b4b8881262ae098c3148614d5dd1bb29..611f9df9ce0719fa73f72b20d7924b18f06aea31 100644 (file)
@@ -25,7 +25,7 @@ namespace System {
 
                public int CompareTo (object v)
                {
-                       if (!(v is System.Double))
+                       if (v == null || !(v is System.Double))
                                throw new ArgumentException ("Value is not a System.Double");
 
                        return (int) (value - ((double) v));
index cf386f197fd330904b19984c7bf5d049e7093629..079f7914f0cfcfba79b76606b69f0040031eade5 100644 (file)
@@ -23,7 +23,7 @@ namespace System {
 
                public int CompareTo (object v)
                {
-                       if (!(v is System.Int16))
+                       if (v == null || !(v is System.Int16))
                                throw new ArgumentException ("Value is not a System.Int16");
 
                        return value - ((short) v);
index 53201229013306eb8f4fbac28a5baf88dfb5b79a..b2baa916a1d477860a5f2471eb5da64b944d3918 100644 (file)
@@ -21,7 +21,7 @@ namespace System {
 
                public int CompareTo (object v)
                {
-                       if (!(v is System.Int32))
+                       if (v == null || !(v is System.Int32))
                                throw new ArgumentException ("Value is not a System.Int32");
 
                        return value - (int) v;
index 16818bf74f94d72faa58db3652b2ebea58aca01d..f4d072a2d729ddabb1cbebee11c88b393baf73c6 100644 (file)
@@ -21,7 +21,7 @@ namespace System {
 
                public int CompareTo (object v)
                {
-                       if (!(v is System.Int64))
+                       if (v == null || !(v is System.Int64))
                                throw new ArgumentException ("Value is not a System.Int64");
 
                        if (value == (long) v)
index 9b56a5daa59c8bdf1fa7e5148acb2c860975706f..322def26b8bc6f056f388b897ad4b31e97f23ed5 100644 (file)
@@ -9,7 +9,12 @@
 
 namespace System {
 
-       public abstract class ParamArrayAttribute {
+       /// <summary>
+       ///   Used to flag that the method will take a variable number
+       ///   of arguments
+       /// </summary>
+       [AttributeUsage(AttributeTargets.Parameter)]
+       public sealed class ParamArrayAttribute : Attribute {
 
                public ParamArrayAttribute ()
                {
index 1b850796e884c6d172af4f3f65d15a0cb676a201..0cc0eb1f970cb2d6fcc7fff70f6bf56af731e1a9 100644 (file)
@@ -24,7 +24,7 @@ namespace System {
 
                public int CompareTo (object v)
                {
-                       if (!(v is System.SByte))
+                       if (v == null || !(v is System.SByte))
                                throw new ArgumentException ("Value is not a System.SByte");
 
                        return value - ((sbyte) v);
index cb898bdeb98355c52c9ee1251ab348cabbdbdd72..322623b5cba83db25d04d5ee1f02360981c16c0f 100644 (file)
@@ -25,7 +25,7 @@ namespace System {
                        
                public int CompareTo (object v)
                {
-                       if (!(v is System.Single))
+                       if (v == null || !(v is System.Single))
                                throw new ArgumentException ("Value is not a System.Single");
 
                        return (int) (value - ((float) v));
index a94bb80854976bbad6d4e6f882a9b804c94f7264..0af4e560ced8a6e81bafa51312d78298e972ec1b 100644 (file)
@@ -22,7 +22,7 @@ namespace System {
 
                public int CompareTo (object v)
                {
-                       if (!(v is System.UInt16))
+                       if (v == null || !(v is System.UInt16))
                                throw new ArgumentException ("Value is not a System.UInt16");
 
                        return value - ((ushort) v);
index 13e28f57a3db32f8b4876ea32ca1edb3c075b68d..d83c912937bd1b9af9cedbea271756b2f39ff367 100644 (file)
@@ -22,7 +22,7 @@ namespace System {
 
                public int CompareTo (object v)
                {
-                       if (!(v is System.UInt32))
+                       if (v == null || !(v is System.UInt32))
                                throw new ArgumentException ("Value is not a System.UInt32");
 
                        if (value == (uint) v)
index d52ca8812174d782cee3a808776ade796222b671..e5bd0076cf9aa0dfad745b7a4aa3098346b93365 100644 (file)
@@ -22,7 +22,7 @@ namespace System {
 
                public int CompareTo (object v)
                {
-                       if (!(v is System.UInt64))
+                       if (v == null || !(v is System.UInt64))
                                throw new ArgumentException ("Value is not a System.UInt64");
 
                        if (value == (ulong) v)