summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Text/EncoderReplacementFallback.cs')
-rw-r--r--src/mscorlib/src/System/Text/EncoderReplacementFallback.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs b/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs
index 15dfee8912..604cddf9bb 100644
--- a/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs
+++ b/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs
@@ -6,6 +6,7 @@ namespace System.Text
{
using System;
using System.Runtime;
+ using System.Diagnostics;
using System.Diagnostics.Contracts;
[Serializable]
@@ -23,7 +24,7 @@ namespace System.Text
{
// Must not be null
if (replacement == null)
- throw new ArgumentNullException("replacement");
+ throw new ArgumentNullException(nameof(replacement));
Contract.EndContractBlock();
// Make sure it doesn't have bad surrogate pairs
@@ -60,7 +61,7 @@ namespace System.Text
break;
}
if (bFoundHigh)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex", "replacement"));
+ throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex", nameof(replacement)));
strDefault = replacement;
}
@@ -147,7 +148,7 @@ namespace System.Text
{
// Double check input surrogate pair
if (!Char.IsHighSurrogate(charUnknownHigh))
- throw new ArgumentOutOfRangeException("charUnknownHigh",
+ throw new ArgumentOutOfRangeException(nameof(charUnknownHigh),
Environment.GetResourceString("ArgumentOutOfRange_Range",
0xD800, 0xDBFF));
@@ -189,7 +190,7 @@ namespace System.Text
}
// Now make sure its in the expected range
- Contract.Assert(fallbackIndex < strDefault.Length && fallbackIndex >= 0,
+ Debug.Assert(fallbackIndex < strDefault.Length && fallbackIndex >= 0,
"Index exceeds buffer range");
return strDefault[fallbackIndex];
@@ -220,7 +221,6 @@ namespace System.Text
}
// Clear the buffer
- [System.Security.SecuritySafeCritical] // auto-generated
public override unsafe void Reset()
{
fallbackCount = -1;