-Sealed non-generic methods on JsonConverter<T>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user