From df5b2ffb815a846999649495bc717cc8714b301f Mon Sep 17 00:00:00 2001 From: Konstantin Triger Date: Thu, 26 Jan 2006 12:56:49 +0000 Subject: TARGET_JVM: catch ObjectDisposedException in addition to ThreadAbortException; optimizing byte[] <-> sbyte[] conversion svn path=/trunk/mcs/; revision=56097 --- mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog | 6 ++++++ .../Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs | 9 +++++++++ .../Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs | 8 ++++++++ 3 files changed, 23 insertions(+) (limited to 'mcs/class/Novell.Directory.Ldap') diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog index ab0f2a0ecda..bfe255f1972 100644 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog +++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/ChangeLog @@ -1,3 +1,9 @@ +2006-01-26 Konstantin Triger + + * Connection.cs: TARGET_JVM: catch ObjectDisposedException in addition + to ThreadAbortException + * SupportClass.cs: TARGET_JVM: optimizing byte[] <-> sbyte[] conversion + 2005-11-06 Konstantin Triger * LdapConnection.cs: TARGET_JVM: create GSSCredential only once, cleanup diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs index 7390259824b..e2886ba09ff 100644 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs +++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs @@ -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) { diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs index 2fe88cf1e6c..7c3b964b421 100644 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs +++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs @@ -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 } /*******************************/ /// @@ -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 } /// -- cgit v1.2.3