2004-12-06 Ben Maurer <bmaurer@ximian.com>
authorBen Maurer <benm@mono-cvs.ximian.com>
Tue, 7 Dec 2004 03:21:58 +0000 (03:21 -0000)
committerBen Maurer <benm@mono-cvs.ximian.com>
Tue, 7 Dec 2004 03:21:58 +0000 (03:21 -0000)
* Exception.cs: Prevent stringifying the type name on the
ctor. this gets called a few times on every execution to create a
nullref exception.

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

mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/Exception.cs

index 440e22d8e1e0be28203d3142461e0ad3c8015446..dc173485c2f43f21329b3c00cee125c0e8a9816f 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-06  Ben Maurer  <bmaurer@ximian.com>
+
+       * Exception.cs: Prevent stringifying the type name on the
+       ctor. this gets called a few times on every execution to create a
+       nullref exception.
+
 2004-12-06  Martin Baulig  <martin@ximian.com>
 
        * Decimal.cs: Decimal constant support has been merged into GMCS,
index caa3f707467fe32d702ae21b0b045e16e851f3b2..90464de4ee4ff1d01dc150833655c749704f2df7 100644 (file)
@@ -50,24 +50,19 @@ namespace System
                string message;
                string help_link;
                string class_name;
-               string stack_trace = null;
-               string remote_stack_trace = "";
-               int remote_stack_index = 0;
+               string stack_trace;
+               string remote_stack_trace;
+               int remote_stack_index;
                int hresult = unchecked ((int)0x80004005);
                string source;
 
                public Exception ()
                {
-                       inner_exception = null;
-                       message = null;
-                       class_name = GetType().FullName;
                }
 
                public Exception (string msg)
                {
-                       inner_exception = null;
                        message = msg;
-                       class_name = GetType().FullName;
                }
 
                protected Exception (SerializationInfo info, StreamingContext sc)
@@ -90,7 +85,6 @@ namespace System
                {
                        inner_exception = e;
                        message = msg;
-                       class_name = GetType().FullName;
                }
 
                public Exception InnerException {
@@ -183,6 +177,9 @@ namespace System
 
                public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
                {
+                       if (class_name == null)
+                               class_name = GetType ().FullName;
+                       
                        info.AddValue ("ClassName", class_name);
                        info.AddValue ("Message", message);
                        info.AddValue ("InnerException", inner_exception);