-Sealed non-generic methods on JsonConverter<T>

This commit is contained in:
James Newton-King
2017-08-13 18:07:00 +12:00
parent 0a6792e4ca
commit 0d924f80ff
+3 -3
View File
@@ -95,7 +95,7 @@ namespace Newtonsoft.Json
/// <param name="writer">The <see cref="JsonWriter"/> to write to.</param>
/// <param name="value">The value.</param>
/// <param name="serializer">The calling serializer.</param>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
public sealed override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
if (!(value != null ? value is T : ReflectionUtils.IsNullable(typeof(T))))
{
@@ -120,7 +120,7 @@ namespace Newtonsoft.Json
/// <param name="existingValue">The existing value of object being read.</param>
/// <param name="serializer">The calling serializer.</param>
/// <returns>The object value.</returns>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
public sealed override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
bool existingIsNull = existingValue == null;
if (!(existingIsNull || existingValue is T))
@@ -148,7 +148,7 @@ namespace Newtonsoft.Json
/// <returns>
/// <c>true</c> if this instance can convert the specified object type; otherwise, <c>false</c>.
/// </returns>
public override bool CanConvert(Type objectType)
public sealed override bool CanConvert(Type objectType)
{
return typeof(T).IsAssignableFrom(objectType);
}