-More object creation refactoring

This commit is contained in:
James Newton-King
2014-05-08 11:21:19 +12:00
parent a750cb9300
commit 1a6f7cdada
15 changed files with 116 additions and 87 deletions
@@ -471,7 +471,7 @@ namespace Newtonsoft.Json.Serialization
if (createdFromNonDefaultCreator)
{
return dictionaryContract.ParametrizedCreator(null, new object[] { dictionary });
return dictionaryContract.ParametrizedCreator(dictionary);
}
else if (dictionary is IWrappedDictionary)
{
@@ -783,7 +783,7 @@ To fix this error either change the JSON to a {1} or change the deserialized typ
else
{
// call constructor that takes IEnumerable<T>
return arrayContract.ParametrizedCreator(null, new object[] {list});
return arrayContract.ParametrizedCreator(list);
}
}
else if (list is IWrappedCollection)
@@ -1568,7 +1568,7 @@ To fix this error either change the environment to be fully trusted, change the
}
#endif
private object CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, Func<object[], object> creator, string id)
private object CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor<object> creator, string id)
{
ValidationUtils.ArgumentNotNull(creator, "creator");