-Refactored buffer pool

This commit is contained in:
James Newton-King
2015-12-13 15:40:37 +13:00
parent 4e2acac33a
commit 815b283e58
48 changed files with 187 additions and 186 deletions
+13 -13
View File
@@ -91,7 +91,7 @@ namespace Newtonsoft.Json
{
if (value == null)
{
throw new ArgumentNullException("value", "Reference resolver cannot be null.");
throw new ArgumentNullException(nameof(value), "Reference resolver cannot be null.");
}
_referenceResolver = value;
@@ -108,7 +108,7 @@ namespace Newtonsoft.Json
{
if (value == null)
{
throw new ArgumentNullException("value", "Serialization binder cannot be null.");
throw new ArgumentNullException(nameof(value), "Serialization binder cannot be null.");
}
_binder = value;
@@ -145,7 +145,7 @@ namespace Newtonsoft.Json
{
if (value < TypeNameHandling.None || value > TypeNameHandling.Auto)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_typeNameHandling = value;
@@ -163,7 +163,7 @@ namespace Newtonsoft.Json
{
if (value < FormatterAssemblyStyle.Simple || value > FormatterAssemblyStyle.Full)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_typeNameAssemblyFormat = value;
@@ -180,7 +180,7 @@ namespace Newtonsoft.Json
{
if (value < PreserveReferencesHandling.None || value > PreserveReferencesHandling.All)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_preserveReferencesHandling = value;
@@ -197,7 +197,7 @@ namespace Newtonsoft.Json
{
if (value < ReferenceLoopHandling.Error || value > ReferenceLoopHandling.Serialize)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_referenceLoopHandling = value;
@@ -214,7 +214,7 @@ namespace Newtonsoft.Json
{
if (value < MissingMemberHandling.Ignore || value > MissingMemberHandling.Error)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_missingMemberHandling = value;
@@ -231,7 +231,7 @@ namespace Newtonsoft.Json
{
if (value < NullValueHandling.Include || value > NullValueHandling.Ignore)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_nullValueHandling = value;
@@ -248,7 +248,7 @@ namespace Newtonsoft.Json
{
if (value < DefaultValueHandling.Include || value > DefaultValueHandling.IgnoreAndPopulate)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_defaultValueHandling = value;
@@ -266,7 +266,7 @@ namespace Newtonsoft.Json
{
if (value < ObjectCreationHandling.Auto || value > ObjectCreationHandling.Replace)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_objectCreationHandling = value;
@@ -284,7 +284,7 @@ namespace Newtonsoft.Json
{
if (value < ConstructorHandling.Default || value > ConstructorHandling.AllowNonPublicDefaultConstructor)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_constructorHandling = value;
@@ -302,7 +302,7 @@ namespace Newtonsoft.Json
{
if (value < MetadataPropertyHandling.Default || value > MetadataPropertyHandling.Ignore)
{
throw new ArgumentOutOfRangeException("value");
throw new ArgumentOutOfRangeException(nameof(value));
}
_metadataPropertyHandling = value;
@@ -443,7 +443,7 @@ namespace Newtonsoft.Json
{
if (value <= 0)
{
throw new ArgumentException("Value must be positive.", "value");
throw new ArgumentException("Value must be positive.", nameof(value));
}
_maxDepth = value;