Author: svetlana
Date: 2005-11-06 05:51:54 -0500 (Sun, 06 Nov 2005)
New Revision: 52621

Modified:
   
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs
   
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog
   
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/RemotingThreadPool.cs
   
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapCore.cs
   
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
Log:
Fix SoapCore.cs and BinaryCore.cs to create new dictionary object for 
Properties during initialization

Modified: 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs
===================================================================
--- 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs
      2005-11-06 10:47:25 UTC (rev 52620)
+++ 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs
      2005-11-06 10:51:54 UTC (rev 52621)
@@ -53,6 +53,11 @@
                {
                        _properties = properties;
                        
+                       if (_properties == null)
+                       {
+                               _properties = new Hashtable(10);
+                       }
+                       
                        foreach(DictionaryEntry property in properties)
                        {
                                string key = (string) property.Key;

Modified: 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog
===================================================================
--- 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog
  2005-11-06 10:47:25 UTC (rev 52620)
+++ 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog
  2005-11-06 10:51:54 UTC (rev 52621)
@@ -1,3 +1,9 @@
+2005-11-06  Svetlana Zholkovsky  <[EMAIL PROTECTED]>
+
+       * Create new dictionary object for Properties during initialization:
+         - SoapCore.cs
+         - BinaryCore.cs
+
 2005-05-18  Lluis Sanchez Gual  <[EMAIL PROTECTED]>
 
        * BinaryServerFormatterSink.cs: Properly handle exceptions raised

Modified: 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/RemotingThreadPool.cs
===================================================================
--- 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/RemotingThreadPool.cs
      2005-11-06 10:47:25 UTC (rev 52620)
+++ 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/RemotingThreadPool.cs
      2005-11-06 10:51:54 UTC (rev 52621)
@@ -45,6 +45,10 @@
                Queue workItems = new Queue ();
                AutoResetEvent threadDone = new AutoResetEvent (false);
                ArrayList runningThreads = new ArrayList ();
+                
+#if TARGET_JVM
+               volatile 
+#endif
                bool stopped = false;
                
                static object globalLock = new object ();
@@ -71,7 +75,11 @@
                                        threadDone.Set ();
                                        workItems.Clear ();
                                        foreach (Thread t in runningThreads)
+#if !TARGET_JVM
                                                t.Abort ();
+#else
+                                               t.Interrupt();
+#endif
                                        runningThreads.Clear ();
                                }
                                if (this == sharedPool)
@@ -130,7 +138,12 @@
                
                void PoolThread ()
                {
+#if !TARGET_JVM
                        while (true) {
+#else
+                       while (!stopped) 
+                       {
+#endif
                                ThreadStart work = null;
                                do {
                                        lock (workItems) {
@@ -155,9 +168,13 @@
                                } while (work == null);
                                try {
                                        work ();
-                               } catch {
-                                       // Can't do anything with the exception
                                }
+                               catch (Exception ex)
+                               {
+#if DEBUG
+                                       Console.WriteLine("The exception was 
caught during RemotingThreadPool.PoolThread - work: {0}, {1}", ex.GetType(), 
ex.Message);
+#endif
+                               }
                        }
                }
        }

Modified: 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapCore.cs
===================================================================
--- 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapCore.cs
        2005-11-06 10:47:25 UTC (rev 52620)
+++ 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapCore.cs
        2005-11-06 10:51:54 UTC (rev 52621)
@@ -53,6 +53,11 @@
                {
                        _properties = properties;
 
+                       if (_properties == null)
+                       {
+                               _properties = new Hashtable(10);
+                       }
+                       
                        foreach(DictionaryEntry property in properties)
                        {
                                string key = (string) property.Key;
@@ -86,6 +91,7 @@
                
                public SoapCore ()
                {
+                       _properties = new Hashtable(10);
                        Init ();
                }
                

Modified: 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
===================================================================
--- 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
    2005-11-06 10:47:25 UTC (rev 52620)
+++ 
trunk/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
    2005-11-06 10:51:54 UTC (rev 52621)
@@ -74,6 +74,34 @@
                        if (sf != null) {
                                if(_serverFaultExceptionField != null)
                                        e = (Exception) 
_serverFaultExceptionField.GetValue(sf);
+#if TARGET_JVM                         
+                               if (e == null && sf.ExceptionType != null)
+                               {
+                                       try
+                                       {
+                                               Type te = 
Type.GetType(sf.ExceptionType);
+                                               if (te != null)
+                                               {
+                                                       ConstructorInfo ce = 
te.GetConstructor(
+                                                               
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | 
BindingFlags.CreateInstance,
+                                                               null, new 
Type[] {typeof(string)}, null);
+
+                                                       if (ce != null)
+                                                       {
+                                                               e = (Exception) 
ce.Invoke(new object[] {sf.ExceptionMessage});
+                                                       }
+                                                       else
+                                                       {
+                                                               e = (Exception) 
Activator.CreateInstance(te);
+                                                       }
+                                               }
+                                       }
+                                       catch
+                                       {
+                                               e = null;
+                                       }
+                               }
+#endif
                        }
                        if (e == null)
                                e = new RemotingException (fault.FaultString);
@@ -399,6 +427,12 @@
                
                object GetNullValue (Type paramType)
                {
+#if TARGET_JVM                 
+                       if (paramType.IsEnum)
+                       {
+                               return Activator.CreateInstance(paramType);
+                       }
+#endif
                        switch (Type.GetTypeCode (paramType))
                        {
                                case TypeCode.Boolean: return false;
@@ -414,7 +448,14 @@
                                case TypeCode.UInt16: return (ushort)0;
                                case TypeCode.UInt32: return (uint)0;
                                case TypeCode.UInt64: return (ulong)0;
-                               default: return null;
+                               default: 
+#if TARGET_JVM                 
+                                       if (paramType.IsValueType)
+                                       {
+                                               return 
Activator.CreateInstance(paramType);
+                                       }
+#endif                                 
+                                       return null;
                        }
                }
        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to