Add null message, to correct parameter use.
authorStephen A. Imhoff <clockwork-muse@outlook.com>
Wed, 26 Oct 2016 07:13:53 +0000 (00:13 -0700)
committerStephen A. Imhoff <clockwork-muse@outlook.com>
Fri, 28 Oct 2016 04:46:41 +0000 (21:46 -0700)
src/mscorlib/src/System/Globalization/EncodingDataItem.cs
src/mscorlib/src/System/Reflection/CustomAttribute.cs
src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs
src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs
src/mscorlib/src/System/RuntimeHandles.cs

index 1dc1bd2..728c44b 100644 (file)
@@ -62,7 +62,7 @@ namespace System.Globalization {
                     }
                 }
 
-                throw new ArgumentException("pStrings");
+                throw new ArgumentException(null, nameof(pStrings));
             }
             else
             {
index 41f2a61..d830765 100644 (file)
@@ -852,7 +852,7 @@ namespace System.Reflection
             CustomAttributeEncoding encodedType = encodedArg.CustomAttributeType.EncodedType;
 
             if (encodedType == CustomAttributeEncoding.Undefined)
-                throw new ArgumentException("encodedArg");
+                throw new ArgumentException(null, nameof(encodedArg));
 
             else if (encodedType == CustomAttributeEncoding.Enum)
             {
index 8041ad2..0262449 100644 (file)
@@ -246,7 +246,7 @@ namespace System.Reflection.Emit
                 if (m_manifestModuleBuilder.InternalModule == module)
                     return m_manifestModuleBuilder;
 
-                throw new ArgumentException("module");
+                throw new ArgumentException(null, nameof(module));
             }
         }
 
index 3ca34e1..e379dee 100644 (file)
@@ -143,7 +143,7 @@ namespace System.Runtime.InteropServices
             if (ptr == IntPtr.Zero)
                 throw new ArgumentNullException(nameof(ptr));
             if (len < 0)
-                throw new ArgumentException("len");
+                throw new ArgumentException(null, nameof(len));
 
             return new String((sbyte *)ptr, 0, len); 
         }
@@ -154,7 +154,7 @@ namespace System.Runtime.InteropServices
             if (ptr == IntPtr.Zero)
                 throw new ArgumentNullException(nameof(ptr));
             if (len < 0)
-                throw new ArgumentException("len");
+                throw new ArgumentException(null, nameof(len));
 
             return new String((char *)ptr, 0, len);
         }
@@ -199,7 +199,7 @@ namespace System.Runtime.InteropServices
         {
             if (byteLen < 0)
             {
-                throw new ArgumentException("byteLen");
+                throw new ArgumentException(null, nameof(byteLen));
             }
             else if (IntPtr.Zero == ptr)
             {
index a56bfbf..4aa4af4 100644 (file)
@@ -582,7 +582,7 @@ namespace System
         internal static RuntimeType GetTypeByNameUsingCARules(string name, RuntimeModule scope)
         {
             if (name == null || name.Length == 0)
-                throw new ArgumentException("name"); 
+                throw new ArgumentException(null, nameof(name)); 
             Contract.EndContractBlock();
 
             RuntimeType type = null;