-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
In src\mono\netcore\System.Private.CoreLib the pattern Exception\s\(" has 340 hits. All these strings should instead come from src\libraries\System.Private.CoreLib\src\Resources\Strings.resx somewhere. In most cases there are already equivalent strings that can be determined by brief inspection of equivalent code in src\coreclr\src\System.Private.CoreLib or possibly src\libraries\System.Private.CoreLib.
Sometimes the strings need adjustment eg throw new ArgumentException ("type is not TypeBuilder but " + type.GetType (), "type"); vs throw new ArgumentException(SR.Argument_MustBeTypeBuilder);.
Some strings are in native code in coreclr eg throw new SynchronizationLockException ("Object is not synchronized"); is not thrown in Monitor.cs in coreclr. In this case it can just be throw new SynchronizationLockException()
A (very?) few may need new strings.
There are also a few trivial cases where the string should be replaced with nameof eg throw new ArgumentException("className") -> throw new ArgumentException(nameof(className))