From: Jan Kotas Date: Wed, 26 Jun 2019 00:24:40 +0000 (-0700) Subject: Delete DeserializationBlockedException (#25393) X-Git-Tag: accepted/tizen/unified/20190813.215958~40^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27b7c2e673c85568374681d1a3270c60946fc3cd;p=platform%2Fupstream%2Fcoreclr.git Delete DeserializationBlockedException (#25393) Contributes to dotnet/corefx#36723 --- diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems index 34dd829..0e914fc 100644 --- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems @@ -710,7 +710,6 @@ - diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Serialization/DeserializationBlockedException.cs b/src/System.Private.CoreLib/shared/System/Runtime/Serialization/DeserializationBlockedException.cs deleted file mode 100644 index 232dc4d..0000000 --- a/src/System.Private.CoreLib/shared/System/Runtime/Serialization/DeserializationBlockedException.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Runtime.Serialization -{ - // Thrown when a dangerous action would be performed during deserialization - [Serializable] - [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] - public sealed class DeserializationBlockedException : SerializationException - { - // Creates a new DeserializationBlockedException with its message - // string set to a default message. - public DeserializationBlockedException() - : base(SR.Serialization_DangerousDeserialization) - { - HResult = HResults.COR_E_SERIALIZATION; - } - - // Creates a new DeserializationBlockedException with a message indicating an opt-out switch - // for a particular part of SerializationGuard - public DeserializationBlockedException(string? message) - : base(message) - { - HResult = HResults.COR_E_SERIALIZATION; - } - - public DeserializationBlockedException(Exception? innerException) - : base(SR.Serialization_DangerousDeserialization, innerException) - { - HResult = HResults.COR_E_SERIALIZATION; - } - - private DeserializationBlockedException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - } -} diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Serialization/SerializationInfo.cs b/src/System.Private.CoreLib/shared/System/Runtime/Serialization/SerializationInfo.cs index afcf0ed..a11fa94 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Serialization/SerializationInfo.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Serialization/SerializationInfo.cs @@ -69,13 +69,13 @@ namespace System.Runtime.Serialization } } - // Throws a DeserializationBlockedException if dangerous deserialization is currently + // Throws a SerializationException if dangerous deserialization is currently // in progress public static void ThrowIfDeserializationInProgress() { if (DeserializationInProgress) { - throw new DeserializationBlockedException(); + throw new SerializationException(SR.Serialization_DangerousDeserialization); } } @@ -118,7 +118,7 @@ namespace System.Runtime.Serialization { if (DeserializationInProgress) { - throw new DeserializationBlockedException(SR.Format(SR.Serialization_DangerousDeserialization_Switch, SwitchPrefix + switchSuffix)); + throw new SerializationException(SR.Format(SR.Serialization_DangerousDeserialization_Switch, SwitchPrefix + switchSuffix)); } } else