Skip to content

Commit a1efd6b

Browse files
committed
Fix some sonarcloud issues
1 parent c0e417c commit a1efd6b

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

src/System.Linq.Dynamic.Core.NewtonsoftJson/Extensions/JObjectExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace System.Linq.Dynamic.Core.NewtonsoftJson.Extensions;
1111
/// </summary>
1212
internal static class JObjectExtensions
1313
{
14-
private class JTokenResolvers : Dictionary<JTokenType, Func<JToken, DynamicJsonClassOptions?, object?>>;
14+
private sealed class JTokenResolvers : Dictionary<JTokenType, Func<JToken, DynamicJsonClassOptions?, object?>>;
1515

1616
private static readonly JTokenResolvers Resolvers = new()
1717
{

src/System.Linq.Dynamic.Core.SystemTextJson/Extensions/JsonDocumentExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace System.Linq.Dynamic.Core.SystemTextJson.Extensions;
88

99
internal static class JsonDocumentExtensions
1010
{
11-
private class JTokenResolvers : Dictionary<JsonValueKind, Func<JsonElement, DynamicJsonClassOptions?, object?>>;
11+
private sealed class JTokenResolvers : Dictionary<JsonValueKind, Func<JsonElement, DynamicJsonClassOptions?, object?>>;
1212

1313
private static readonly JTokenResolvers Resolvers = new()
1414
{

src/System.Linq.Dynamic.Core/Extensions/ListExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace System.Linq.Dynamic.Core.Extensions;
55
internal static class ListExtensions
66
{
77
internal static void AddIfNotNull<T>(this IList<T> list, T? value)
8+
where T : class
89
{
910
if (value != null)
1011
{

src/System.Linq.Dynamic.Core/Parser/ExpressionParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,7 @@ private bool TryFindPropertyOrField(Type type, string id, Expression? expression
19801980
switch (member)
19811981
{
19821982
case PropertyInfo property:
1983-
var propertyIsStatic = property?.GetGetMethod().IsStatic ?? property?.GetSetMethod().IsStatic ?? false;
1983+
var propertyIsStatic = property.GetGetMethod()?.IsStatic ?? property.GetSetMethod()?.IsStatic ?? false;
19841984
propertyOrFieldExpression = propertyIsStatic ? Expression.Property(null, property) : Expression.Property(expression, property);
19851985
return true;
19861986

src/System.Linq.Dynamic.Core/Parser/SupportedMethods/MethodFinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal class MethodFinder
1010
{
1111
private readonly ParsingConfig _parsingConfig;
1212
private readonly IExpressionHelper _expressionHelper;
13-
private readonly IDictionary<Type, MethodInfo[]> _cachedMethods;
13+
private readonly Dictionary<Type, MethodInfo[]> _cachedMethods;
1414

1515
/// <summary>
1616
/// #794

0 commit comments

Comments
 (0)