summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/TypeNameParser.cs
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
commita56e30c8d33048216567753d9d3fefc2152af8ac (patch)
tree7e5d979695fc4a431740982eb1cfecc2898b23a5 /src/mscorlib/src/System/TypeNameParser.cs
parent4b11dc566a5bbfa1378d6266525c281b028abcc8 (diff)
downloadcoreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.gz
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.bz2
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.zip
Imported Upstream version 2.0.0.11353upstream/2.0.0.11353
Diffstat (limited to 'src/mscorlib/src/System/TypeNameParser.cs')
-rw-r--r--src/mscorlib/src/System/TypeNameParser.cs19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mscorlib/src/System/TypeNameParser.cs b/src/mscorlib/src/System/TypeNameParser.cs
index 844578210f..f9d608968f 100644
--- a/src/mscorlib/src/System/TypeNameParser.cs
+++ b/src/mscorlib/src/System/TypeNameParser.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+
using System;
using System.Diagnostics;
using System.Diagnostics.Contracts;
@@ -73,7 +74,7 @@ namespace System
if (typeName == null)
throw new ArgumentNullException(nameof(typeName));
if (typeName.Length > 0 && typeName[0] == '\0')
- throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength"));
+ throw new ArgumentException(SR.Format_StringZeroLength);
Contract.EndContractBlock();
Type ret = null;
@@ -96,7 +97,7 @@ namespace System
#region Private Data Members
private SafeTypeNameParserHandle m_NativeParser;
- private static readonly char[] SPECIAL_CHARS = {',', '[', ']', '&', '*', '+', '\\'}; /* see typeparse.h */
+ private static readonly char[] SPECIAL_CHARS = { ',', '[', ']', '&', '*', '+', '\\' }; /* see typeparse.h */
#endregion
#region Constructor and Disposer
@@ -142,7 +143,7 @@ namespace System
{
// This can only happen if the type name is an empty string or if the first char is '\0'
if (throwOnError)
- throw new TypeLoadException(Environment.GetResourceString("Arg_TypeLoadNullStr"));
+ throw new TypeLoadException(SR.Arg_TypeLoadNullStr);
return null;
}
@@ -207,7 +208,7 @@ namespace System
// Other exceptions like BadImangeFormatException should still fly.
try
{
- assembly = RuntimeAssembly.InternalLoad(asmName, null, ref stackMark, false /*forIntrospection*/);
+ assembly = RuntimeAssembly.InternalLoad(asmName, null, ref stackMark, false /*forIntrospection*/);
}
catch (FileNotFoundException)
{
@@ -220,7 +221,7 @@ namespace System
assembly = assemblyResolver(new AssemblyName(asmName));
if (assembly == null && throwOnError)
{
- throw new FileNotFoundException(Environment.GetResourceString("FileNotFound_ResolveAssembly", asmName));
+ throw new FileNotFoundException(SR.Format(SR.FileNotFound_ResolveAssembly, asmName));
}
}
@@ -244,8 +245,8 @@ namespace System
if (type == null && throwOnError)
{
string errorString = assembly == null ?
- Environment.GetResourceString("TypeLoad_ResolveType", OuterMostTypeName) :
- Environment.GetResourceString("TypeLoad_ResolveTypeFromAssembly", OuterMostTypeName, assembly.FullName);
+ SR.Format(SR.TypeLoad_ResolveType, OuterMostTypeName):
+ SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, OuterMostTypeName, assembly.FullName);
throw new TypeLoadException(errorString);
}
@@ -276,7 +277,7 @@ namespace System
if (type == null)
{
if (throwOnError)
- throw new TypeLoadException(Environment.GetResourceString("TypeLoad_ResolveNestedType", names[i], names[i-1]));
+ throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveNestedType, names[i], names[i - 1]));
else
break;
}
@@ -339,7 +340,7 @@ namespace System
{
string assemblyName = null;
_GetAssemblyName(m_NativeParser, JitHelpers.GetStringHandleOnStack(ref assemblyName));
-
+
return assemblyName;
}
#endregion