From 4d7a551d9eb9ecb470366f8b8fc44791b112776c Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 4 Oct 2017 15:02:02 +0200 Subject: [PATCH] Remove Contract.EndContractBlock and parameter check that gets handled in the base impl --- .../System/Runtime/CompilerServices/RuntimeWrappedException.cs | 5 ----- src/mscorlib/src/System/MissingMemberException.cs | 5 ----- src/mscorlib/src/System/TypeLoadException.cs | 6 +----- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeWrappedException.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeWrappedException.cs index c86a232..af3b0c9 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeWrappedException.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/RuntimeWrappedException.cs @@ -28,11 +28,6 @@ namespace System.Runtime.CompilerServices public override void GetObjectData(SerializationInfo info, StreamingContext context) { - if (info == null) - { - throw new ArgumentNullException(nameof(info)); - } - Contract.EndContractBlock(); base.GetObjectData(info, context); info.AddValue("WrappedException", _wrappedException, typeof(object)); } diff --git a/src/mscorlib/src/System/MissingMemberException.cs b/src/mscorlib/src/System/MissingMemberException.cs index c818169..95ad711 100644 --- a/src/mscorlib/src/System/MissingMemberException.cs +++ b/src/mscorlib/src/System/MissingMemberException.cs @@ -78,11 +78,6 @@ namespace System public override void GetObjectData(SerializationInfo info, StreamingContext context) { - if (info == null) - { - throw new ArgumentNullException(nameof(info)); - } - Contract.EndContractBlock(); base.GetObjectData(info, context); info.AddValue("MMClassName", ClassName, typeof(string)); info.AddValue("MMSignature", Signature, typeof(byte[])); diff --git a/src/mscorlib/src/System/TypeLoadException.cs b/src/mscorlib/src/System/TypeLoadException.cs index 13f8651..cbac2fe 100644 --- a/src/mscorlib/src/System/TypeLoadException.cs +++ b/src/mscorlib/src/System/TypeLoadException.cs @@ -108,7 +108,7 @@ namespace System { if (info == null) throw new ArgumentNullException(nameof(info)); - Contract.EndContractBlock(); + ClassName = info.GetString("TypeLoadClassName"); AssemblyName = info.GetString("TypeLoadAssemblyName"); MessageArg = info.GetString("TypeLoadMessageArg"); @@ -121,10 +121,6 @@ namespace System public override void GetObjectData(SerializationInfo info, StreamingContext context) { - if (info == null) - throw new ArgumentNullException(nameof(info)); - Contract.EndContractBlock(); - base.GetObjectData(info, context); info.AddValue("TypeLoadClassName", ClassName, typeof(string)); info.AddValue("TypeLoadAssemblyName", AssemblyName, typeof(string)); -- 2.7.4