TARGET_JVM: catch ObjectDisposedException in addition to ThreadAbortException; optimi...
authorKonstantin Triger <kostat@mono-cvs.ximian.com>
Thu, 26 Jan 2006 12:56:49 +0000 (12:56 -0000)
committerKonstantin Triger <kostat@mono-cvs.ximian.com>
Thu, 26 Jan 2006 12:56:49 +0000 (12:56 -0000)
svn path=/trunk/mcs/; revision=56097

mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog
mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs
mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs

index ab0f2a0ecdaa496a1baa6fdead9ef67847317756..bfe255f1972e6d297c7eec821768693ca075e3fd 100644 (file)
@@ -1,3 +1,9 @@
+2006-01-26 Konstantin Triger <kostat@mainsoft.com>
+
+        * Connection.cs: TARGET_JVM: catch ObjectDisposedException in addition 
+               to ThreadAbortException
+        * SupportClass.cs: TARGET_JVM: optimizing byte[] <-> sbyte[] conversion
+
 2005-11-06 Konstantin Triger <kostat@mainsoft.com>
 
         * LdapConnection.cs: TARGET_JVM: create GSSCredential only once, cleanup
index 7390259824b1cf3139475650372bbb8d4a2d7bf3..e2886ba09ff385dc18e3bf849871db0c140478f8 100644 (file)
@@ -1508,6 +1508,15 @@ namespace Novell.Directory.Ldap
                                        // before closing sockets, from shutdown
                                        return;
                                }
+#if TARGET_JVM
+                               catch (ObjectDisposedException)
+                               {
+                                       // we do not support Thread.Abort under java
+                                       // so we close the stream and the working thread
+                                       // catches ObjectDisposedException exception
+                                       return;
+                               }
+#endif
                                catch (System.IO.IOException ioe)
                                {
                                        
index 2fe88cf1e6c01ec1fedf40c1c7f4b017c546af0a..7c3b964b421abcbafba351d7b3be979e05f022a6 100644 (file)
@@ -87,10 +87,14 @@ using System;
                [CLSCompliantAttribute(false)]
                public static sbyte[] ToSByteArray(byte[] byteArray)
                {
+#if TARGET_JVM
+                       return vmw.common.TypeUtils.ToSByteArray(byteArray);
+#else
                        sbyte[] sbyteArray = new sbyte[byteArray.Length];
                        for(int index=0; index < byteArray.Length; index++)
                                sbyteArray[index] = (sbyte) byteArray[index];
                        return sbyteArray;
+#endif
                }
                /*******************************/
                /// <summary>
@@ -101,10 +105,14 @@ using System;
                [CLSCompliantAttribute(false)]
                public static byte[] ToByteArray(sbyte[] sbyteArray)
                {
+#if TARGET_JVM
+                       return (byte[])vmw.common.TypeUtils.ToByteArray(sbyteArray);;
+#else
                        byte[] byteArray = new byte[sbyteArray.Length];
                        for(int index=0; index < sbyteArray.Length; index++)
                                byteArray[index] = (byte) sbyteArray[index];
                        return byteArray;
+#endif
                }
 
                /// <summary>