Skip to content

Commit

Permalink
Remove compiler package and update sourcelink (#2498)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK authored Mar 17, 2021
1 parent 8ef6621 commit ae9fe44
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions Src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
<AutofacPackageVersion>4.6.2</AutofacPackageVersion>
<BenchmarkDotNetPackageVersion>0.10.10</BenchmarkDotNetPackageVersion>
<FSharpCorePackageVersion>4.2.3</FSharpCorePackageVersion>
<MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion>2.9.2</MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion>
<MicrosoftCodeAnalysisNetAnalyzersPackageVersion>5.0.3</MicrosoftCodeAnalysisNetAnalyzersPackageVersion>
<MicrosoftCSharpPackageVersion>4.3.0</MicrosoftCSharpPackageVersion>
<MicrosoftSourceLinkGitHubPackageVersion>1.0.0-beta2-19367-01</MicrosoftSourceLinkGitHubPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>3.8.0</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftSourceLinkGitHubPackageVersion>1.0.0</MicrosoftSourceLinkGitHubPackageVersion>
<MicrosoftNETTestSdkPackageVersion>16.3.0</MicrosoftNETTestSdkPackageVersion>
<MoqPackageVersion>4.8.1</MoqPackageVersion>
<NunitPackageVersion>3.11.0</NunitPackageVersion>
Expand Down
4 changes: 1 addition & 3 deletions Src/Newtonsoft.Json/JsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -867,9 +867,7 @@ internal virtual void PopulateInternal(JsonReader reader, object target)
[DebuggerStepThrough]
public T? Deserialize<T>(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));

This comment has been minimized.

Copy link
@x544D

x544D Jun 24, 2022

@JamesNK Removing this might cause Memory Leek, No ?

}

/// <summary>
Expand Down
4 changes: 1 addition & 3 deletions Src/Newtonsoft.Json/Newtonsoft.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@
<None Include="$(PackageIconFullPath)" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="$(MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion)" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="$(MicrosoftCodeAnalysisNetAnalyzersPackageVersion)" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" />
<!-- Compiler to support nullable in non-preview VS2019 -->
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="$(MicrosoftNetCompilersToolsetPackageVersion)" PrivateAssets="All" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
<AssemblyTitle>Json.NET</AssemblyTitle>
Expand Down
4 changes: 4 additions & 0 deletions Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
}
Expand Down

0 comments on commit ae9fe44

Please # to comment.