From ae9fe44e1323e91bcbd185ca1a14099fba7c021f Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 18 Mar 2021 08:55:07 +1300 Subject: [PATCH] Remove compiler package and update sourcelink (#2498) --- Src/Directory.Build.props | 5 ++--- Src/Newtonsoft.Json/JsonSerializer.cs | 4 +--- Src/Newtonsoft.Json/Newtonsoft.Json.csproj | 4 +--- Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs | 4 ++++ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Src/Directory.Build.props b/Src/Directory.Build.props index 11ecc4181..661350885 100644 --- a/Src/Directory.Build.props +++ b/Src/Directory.Build.props @@ -3,10 +3,9 @@ 4.6.2 0.10.10 4.2.3 - 2.9.2 + 5.0.3 4.3.0 - 1.0.0-beta2-19367-01 - 3.8.0 + 1.0.0 16.3.0 4.8.1 3.11.0 diff --git a/Src/Newtonsoft.Json/JsonSerializer.cs b/Src/Newtonsoft.Json/JsonSerializer.cs index c4e6b6930..23f5c6b62 100644 --- a/Src/Newtonsoft.Json/JsonSerializer.cs +++ b/Src/Newtonsoft.Json/JsonSerializer.cs @@ -867,9 +867,7 @@ internal virtual void PopulateInternal(JsonReader reader, object target) [DebuggerStepThrough] public T? Deserialize(JsonReader reader) { -#pragma warning disable CS8601 // Possible null reference assignment. - return (T)Deserialize(reader, typeof(T)); -#pragma warning restore CS8601 // Possible null reference assignment. + return (T?)Deserialize(reader, typeof(T)); } /// diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.csproj index bbb6328aa..4dd7b55a0 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.csproj @@ -39,10 +39,8 @@ - + - - Json.NET diff --git a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs index 9b62e0709..a92e2639b 100644 --- a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs +++ b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs @@ -492,8 +492,12 @@ void IDictionary.Add(object key, object value) #endif else { + // Consider changing this code to call GenericDictionary.Remove when value is null. + // #pragma warning disable CS8601 // Possible null reference assignment. +#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. GenericDictionary[(TKey)key] = (TValue)value; +#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type. #pragma warning restore CS8601 // Possible null reference assignment. } }