From 0cae769f3c60bf2a696d02a88527a46d5b211cd5 Mon Sep 17 00:00:00 2001 From: "Stephen A. Imhoff" Date: Tue, 25 Oct 2016 23:07:38 -0700 Subject: [PATCH] Correct parameter names. --- .../Eventing/TraceLogging/TraceLoggingTypeInfo.cs | 2 +- src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs | 2 +- src/mscorlib/src/System/IO/Directory.cs | 2 +- src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs | 2 +- src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs | 8 ++++---- .../src/System/Reflection/RuntimeReflectionExtensions.cs | 12 ++++++------ 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingTypeInfo.cs b/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingTypeInfo.cs index 0cc17e0..d68e106 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingTypeInfo.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingTypeInfo.cs @@ -61,7 +61,7 @@ namespace System.Diagnostics.Tracing if (name == null) { - throw new ArgumentNullException("eventName"); + throw new ArgumentNullException(nameof(name)); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs b/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs index 8bf8460..8a28250 100644 --- a/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs +++ b/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs @@ -1370,7 +1370,7 @@ namespace System.Globalization { Contract.Requires(values.Length >= length); for (int i = 0; i < length; i++) { if (values[i] == null) { - throw new ArgumentNullException("value", + throw new ArgumentNullException("values[" + i + "]", Environment.GetResourceString("ArgumentNull_ArrayValue")); } } diff --git a/src/mscorlib/src/System/IO/Directory.cs b/src/mscorlib/src/System/IO/Directory.cs index 3c4774b..ba40000 100644 --- a/src/mscorlib/src/System/IO/Directory.cs +++ b/src/mscorlib/src/System/IO/Directory.cs @@ -1048,7 +1048,7 @@ namespace System.IO { public static void SetCurrentDirectory(String path) { if (path==null) - throw new ArgumentNullException("value"); + throw new ArgumentNullException(nameof(path)); if (path.Length==0) throw new ArgumentException(Environment.GetResourceString("Argument_PathEmpty")); Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs index af5136b..69ecc7f 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -2061,7 +2061,7 @@ namespace System.Reflection.Emit private FieldToken GetFieldTokenNoLock(FieldInfo field) { if (field == null) { - throw new ArgumentNullException("con"); + throw new ArgumentNullException(nameof(field)); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs b/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs index 102cbc9..c8096b8 100644 --- a/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs +++ b/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs @@ -193,15 +193,15 @@ namespace System.Reflection.Emit } [System.Security.SecurityCritical] // auto-generated - internal static SignatureHelper GetTypeSigToken(Module mod, Type type) + internal static SignatureHelper GetTypeSigToken(Module module, Type type) { - if (mod == null) - throw new ArgumentNullException("module"); + if (module == null) + throw new ArgumentNullException(nameof(module)); if (type == null) throw new ArgumentNullException(nameof(type)); - return new SignatureHelper(mod, type); + return new SignatureHelper(module, type); } #endregion diff --git a/src/mscorlib/src/System/Reflection/RuntimeReflectionExtensions.cs b/src/mscorlib/src/System/Reflection/RuntimeReflectionExtensions.cs index 00ab975..4926263 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeReflectionExtensions.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeReflectionExtensions.cs @@ -10,16 +10,16 @@ namespace System.Reflection { private const BindingFlags everything = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static; - private static void CheckAndThrow(Type t) + private static void CheckAndThrow(Type type) { - if (t == null) throw new ArgumentNullException("type"); - if (!(t is RuntimeType)) throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType")); + if (type == null) throw new ArgumentNullException(nameof(type)); + if (!(type is RuntimeType)) throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType")); } - private static void CheckAndThrow(MethodInfo m) + private static void CheckAndThrow(MethodInfo method) { - if (m == null) throw new ArgumentNullException("method"); - if (!(m is RuntimeMethodInfo)) throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo")); + if (method == null) throw new ArgumentNullException(nameof(method)); + if (!(method is RuntimeMethodInfo)) throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo")); } public static IEnumerable GetRuntimeProperties(this Type type) -- 2.7.4