From a56e30c8d33048216567753d9d3fefc2152af8ac Mon Sep 17 00:00:00 2001 From: Jiyoung Yun Date: Thu, 13 Apr 2017 14:17:19 +0900 Subject: Imported Upstream version 2.0.0.11353 --- src/mscorlib/src/System/WeakReferenceOfT.cs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/mscorlib/src/System/WeakReferenceOfT.cs') diff --git a/src/mscorlib/src/System/WeakReferenceOfT.cs b/src/mscorlib/src/System/WeakReferenceOfT.cs index 0972e5fb9e..fbb6f09098 100644 --- a/src/mscorlib/src/System/WeakReferenceOfT.cs +++ b/src/mscorlib/src/System/WeakReferenceOfT.cs @@ -8,19 +8,20 @@ ** Purpose: A wrapper for establishing a WeakReference to a generic type. ** ===========================================================*/ + +using System; +using System.Runtime.Serialization; +using System.Security; +using System.Runtime; +using System.Runtime.CompilerServices; +using System.Runtime.Versioning; +using System.Diagnostics.Contracts; + namespace System { - using System; - using System.Runtime.Serialization; - using System.Security; - using System.Runtime; - using System.Runtime.CompilerServices; - using System.Runtime.Versioning; - using System.Diagnostics.Contracts; - [Serializable] // This class is sealed to mitigate security issues caused by Object::MemberwiseClone. - public sealed class WeakReference : ISerializable + public sealed class WeakReference : ISerializable where T : class { // If you fix bugs here, please fix them in WeakReference at the same time. @@ -45,7 +46,8 @@ namespace System internal WeakReference(SerializationInfo info, StreamingContext context) { - if (info == null) { + if (info == null) + { throw new ArgumentNullException(nameof(info)); } Contract.EndContractBlock(); @@ -97,7 +99,8 @@ namespace System public void GetObjectData(SerializationInfo info, StreamingContext context) { - if (info == null) { + if (info == null) + { throw new ArgumentNullException(nameof(info)); } Contract.EndContractBlock(); -- cgit v1.2.3