Skip to content

Commit ae9fe44

Browse files
authored
Remove compiler package and update sourcelink (#2498)
1 parent 8ef6621 commit ae9fe44

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Src/Directory.Build.props

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
<AutofacPackageVersion>4.6.2</AutofacPackageVersion>
44
<BenchmarkDotNetPackageVersion>0.10.10</BenchmarkDotNetPackageVersion>
55
<FSharpCorePackageVersion>4.2.3</FSharpCorePackageVersion>
6-
<MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion>2.9.2</MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion>
6+
<MicrosoftCodeAnalysisNetAnalyzersPackageVersion>5.0.3</MicrosoftCodeAnalysisNetAnalyzersPackageVersion>
77
<MicrosoftCSharpPackageVersion>4.3.0</MicrosoftCSharpPackageVersion>
8-
<MicrosoftSourceLinkGitHubPackageVersion>1.0.0-beta2-19367-01</MicrosoftSourceLinkGitHubPackageVersion>
9-
<MicrosoftNetCompilersToolsetPackageVersion>3.8.0</MicrosoftNetCompilersToolsetPackageVersion>
8+
<MicrosoftSourceLinkGitHubPackageVersion>1.0.0</MicrosoftSourceLinkGitHubPackageVersion>
109
<MicrosoftNETTestSdkPackageVersion>16.3.0</MicrosoftNETTestSdkPackageVersion>
1110
<MoqPackageVersion>4.8.1</MoqPackageVersion>
1211
<NunitPackageVersion>3.11.0</NunitPackageVersion>

Src/Newtonsoft.Json/JsonSerializer.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -867,9 +867,7 @@ internal virtual void PopulateInternal(JsonReader reader, object target)
867867
[DebuggerStepThrough]
868868
public T? Deserialize<T>(JsonReader reader)
869869
{
870-
#pragma warning disable CS8601 // Possible null reference assignment.
871-
return (T)Deserialize(reader, typeof(T));
872-
#pragma warning restore CS8601 // Possible null reference assignment.
870+
return (T?)Deserialize(reader, typeof(T));
873871
}
874872

875873
/// <summary>

Src/Newtonsoft.Json/Newtonsoft.Json.csproj

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@
3939
<None Include="$(PackageIconFullPath)" Pack="true" PackagePath="\"/>
4040
</ItemGroup>
4141
<ItemGroup>
42-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="$(MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion)" PrivateAssets="All" />
42+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="$(MicrosoftCodeAnalysisNetAnalyzersPackageVersion)" PrivateAssets="All" />
4343
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" />
44-
<!-- Compiler to support nullable in non-preview VS2019 -->
45-
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="$(MicrosoftNetCompilersToolsetPackageVersion)" PrivateAssets="All" />
4644
</ItemGroup>
4745
<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
4846
<AssemblyTitle>Json.NET</AssemblyTitle>

Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs

+4
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,12 @@ void IDictionary.Add(object key, object value)
492492
#endif
493493
else
494494
{
495+
// Consider changing this code to call GenericDictionary.Remove when value is null.
496+
//
495497
#pragma warning disable CS8601 // Possible null reference assignment.
498+
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
496499
GenericDictionary[(TKey)key] = (TValue)value;
500+
#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type.
497501
#pragma warning restore CS8601 // Possible null reference assignment.
498502
}
499503
}

0 commit comments

Comments
 (0)