diff options
author | Konstantin Triger <kostat@mono-cvs.ximian.com> | 2006-01-26 15:56:49 +0300 |
---|---|---|
committer | Konstantin Triger <kostat@mono-cvs.ximian.com> | 2006-01-26 15:56:49 +0300 |
commit | df5b2ffb815a846999649495bc717cc8714b301f (patch) | |
tree | e01ec49fd2a3080a4f8c4d381a13739bfedf0a8d /mcs/class/Novell.Directory.Ldap | |
parent | 52a9784f641775476c7443c954fc0d691838b1ea (diff) |
TARGET_JVM: catch ObjectDisposedException in addition to ThreadAbortException; optimizing byte[] <-> sbyte[] conversion
svn path=/trunk/mcs/; revision=56097
Diffstat (limited to 'mcs/class/Novell.Directory.Ldap')
3 files changed, 23 insertions, 0 deletions
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 <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 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 } /*******************************/ /// <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> |