Make StringComparer.Create throw ArgumentNullException (dotnet/coreclr#26570)
authorTyler Brinkley <Tydude4Christ@hotmail.com>
Tue, 10 Sep 2019 01:08:53 +0000 (20:08 -0500)
committerStephen Toub <stoub@microsoft.com>
Tue, 10 Sep 2019 01:08:53 +0000 (21:08 -0400)
* Make StringComparer.Create throw ArgumentNullException

Throws proper exception.

* Update CoreFX.issues.rsp

Commit migrated from https://github.com/dotnet/coreclr/commit/69ff008fde9a23996029c4fa25b6f4fba4d815cf

src/coreclr/tests/CoreFX/CoreFX.issues.rsp
src/libraries/System.Private.CoreLib/src/System/StringComparer.cs

index 463c1e2ee9c420154f889610529f81c1fdccec25..a8293465592f8746c1f5b6c1b2809a50c2c47d29 100644 (file)
@@ -80,6 +80,9 @@
 # Test failure: https://github.com/dotnet/corefx/issues/39223
 -nomethod System.ComponentModel.TypeConverterTests.FontConverterTest.TestConvertFrom
 
+# Test failure: https://github.com/dotnet/coreclr/pull/26570
+-nomethod System.Tests.StringComparerTests.CreateCultureOptions_InvalidArguments_Throws
+
 # corefx tests need to be updated for changes to GetHashCode
 -nomethod System.Numerics.Tests.GenericVectorTests.GetHashCodeInt16
 -nomethod System.Numerics.Tests.GenericVectorTests.GetHashCodeInt32
index 527a452989e841c5d472a510208e0fff7ef407f2..8d88ccaa9e2b66616acc8e548d19f206c08d700b 100644 (file)
@@ -61,7 +61,7 @@ namespace System
         {
             if (culture == null)
             {
-                throw new ArgumentException(nameof(culture));
+                throw new ArgumentNullException(nameof(culture));
             }
 
             return new CultureAwareComparer(culture, options);