From 84d26bfa864b0fa31dd4ca398d8ba749a732fd06 Mon Sep 17 00:00:00 2001 From: Emre Yigit Date: Mon, 4 May 2026 14:54:06 +0300 Subject: [PATCH] Fix simple-no code change- compiler warnings. --- .../Hazelcast.Net.Benchmarks.csproj | 1 + .../HazelcastOptionsExtensions.cs | 1 + .../HostBuilderExtensions.cs | 3 +++ src/Hazelcast.Net.Linq.Async/HMapExtension.cs | 1 + src/Hazelcast.Net.Linq.Async/MapEntry.cs | 5 ++++- src/Hazelcast.Net.Testing/Remote/CloudException.cs | 7 +++---- src/Hazelcast.Net.Testing/Remote/Lang.cs | 5 ++--- src/Hazelcast.Net.Testing/Remote/Member.cs | 5 ++--- src/Hazelcast.Net.Testing/Remote/RemoteController.cs | 11 ++++++++--- src/Hazelcast.Net.Testing/Remote/Response.cs | 5 ++--- src/Hazelcast.Net.Testing/Remote/ServerException.cs | 7 +++---- src/Hazelcast.Net.Tests/CP/CPMapTests.cs | 1 - src/Hazelcast.Net.Tests/Clustering/FailoverTests.cs | 2 +- src/Hazelcast.Net.Tests/Clustering/FailoverTests2.cs | 2 +- .../Models/HazelcastDataTypesTests.cs | 4 ++++ .../Networking/ClientSslTestBase.cs | 4 ---- .../Serialization/Compact/RemoteToObjectFirstTests.cs | 2 +- .../Serialization/Objects/KitchenSinkPortable.cs | 4 ++-- .../Security/KerberosTokenProvider.cs | 1 + .../Security/Win32/CredentialHandle.cs | 4 ++++ src/Hazelcast.Net/CP/ClusterCPGroups.cs | 2 +- src/Hazelcast.Net/Clustering/Authenticator.cs | 2 ++ src/Hazelcast.Net/Clustering/ClusterConnections.cs | 2 +- src/Hazelcast.Net/Clustering/ClusterMembers.cs | 4 +++- src/Hazelcast.Net/Clustering/ClusterMessaging.cs | 7 ++++++- src/Hazelcast.Net/Clustering/MemberPartitionGroup.cs | 2 +- src/Hazelcast.Net/Configuration/DynamicOptions.cs | 2 +- src/Hazelcast.Net/Hazelcast.Net.csproj | 3 +++ src/Hazelcast.Net/Messaging/Frame.cs | 1 + src/Hazelcast.Net/Models/SingleVectorValues.cs | 5 +++++ .../Protocol/Codecs/CPSessionCloseSessionCodec.cs | 2 +- src/Hazelcast.Net/Protocol/Models/VectorPairHolder.cs | 5 +++-- src/Hazelcast.Net/Serialization/ObjectDataOutput.cs | 2 +- .../Serialization/SerializationService.cs | 4 ++++ 34 files changed, 77 insertions(+), 41 deletions(-) diff --git a/src/Hazelcast.Net.Benchmarks/Hazelcast.Net.Benchmarks.csproj b/src/Hazelcast.Net.Benchmarks/Hazelcast.Net.Benchmarks.csproj index 531e9ad285..64c5e80d3a 100644 --- a/src/Hazelcast.Net.Benchmarks/Hazelcast.Net.Benchmarks.csproj +++ b/src/Hazelcast.Net.Benchmarks/Hazelcast.Net.Benchmarks.csproj @@ -5,6 +5,7 @@ net10.0 Hazelcast.Benchmarks hb + $(NoWarn);CS1591 diff --git a/src/Hazelcast.Net.DependencyInjection/HazelcastOptionsExtensions.cs b/src/Hazelcast.Net.DependencyInjection/HazelcastOptionsExtensions.cs index c8bd2e76f4..e5357b1de1 100644 --- a/src/Hazelcast.Net.DependencyInjection/HazelcastOptionsExtensions.cs +++ b/src/Hazelcast.Net.DependencyInjection/HazelcastOptionsExtensions.cs @@ -17,6 +17,7 @@ namespace Hazelcast.DependencyInjection; +/// Extension methods for and its derivatives. public static class HazelcastOptionsExtensions { /// diff --git a/src/Hazelcast.Net.DependencyInjection/HostBuilderExtensions.cs b/src/Hazelcast.Net.DependencyInjection/HostBuilderExtensions.cs index a0aaff060f..5008678e02 100644 --- a/src/Hazelcast.Net.DependencyInjection/HostBuilderExtensions.cs +++ b/src/Hazelcast.Net.DependencyInjection/HostBuilderExtensions.cs @@ -17,11 +17,14 @@ namespace Hazelcast.DependencyInjection { + /// Extension methods for . public static class HostBuilderExtensions { + /// Configures Hazelcast with default settings. public static IHostBuilder ConfigureHazelcast(this IHostBuilder hostBuilder) => hostBuilder.ConfigureHazelcast(Array.Empty()); + /// Configures Hazelcast with the specified command-line arguments. public static IHostBuilder ConfigureHazelcast(this IHostBuilder builder, string[] args) { return builder.ConfigureAppConfiguration((hostingContext, hostBuilder) => diff --git a/src/Hazelcast.Net.Linq.Async/HMapExtension.cs b/src/Hazelcast.Net.Linq.Async/HMapExtension.cs index f4fe22e9ae..da8fbc4176 100644 --- a/src/Hazelcast.Net.Linq.Async/HMapExtension.cs +++ b/src/Hazelcast.Net.Linq.Async/HMapExtension.cs @@ -17,6 +17,7 @@ namespace Hazelcast.Linq { + /// Extension methods for providing LINQ support. public static class HMapExtension { /// diff --git a/src/Hazelcast.Net.Linq.Async/MapEntry.cs b/src/Hazelcast.Net.Linq.Async/MapEntry.cs index 0735d8ab9a..eadce7c753 100644 --- a/src/Hazelcast.Net.Linq.Async/MapEntry.cs +++ b/src/Hazelcast.Net.Linq.Async/MapEntry.cs @@ -22,6 +22,9 @@ namespace Hazelcast.Linq /// Type of Value public struct MapEntry { + /// Initializes a new instance of the struct. + /// The key. + /// The value. public MapEntry(TKey key, TValue value) { Key = key; @@ -40,7 +43,7 @@ public MapEntry(TKey key, TValue value) /// - /// Deconstructs the current + /// Deconstructs the current . /// public void Deconstruct(out TKey key, out TValue value) { diff --git a/src/Hazelcast.Net.Testing/Remote/CloudException.cs b/src/Hazelcast.Net.Testing/Remote/CloudException.cs index 7ee2f0b521..9564ba1251 100644 --- a/src/Hazelcast.Net.Testing/Remote/CloudException.cs +++ b/src/Hazelcast.Net.Testing/Remote/CloudException.cs @@ -11,11 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -/** - * +/* + * auto-generated * Autogenerated by Thrift Compiler (0.18.0) * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * */ using System; using System.Collections; @@ -51,7 +50,7 @@ public partial class CloudException : TException, TBase { private string _message; - public string Message + public new string Message { get { diff --git a/src/Hazelcast.Net.Testing/Remote/Lang.cs b/src/Hazelcast.Net.Testing/Remote/Lang.cs index aa18845d45..7fa59069ab 100644 --- a/src/Hazelcast.Net.Testing/Remote/Lang.cs +++ b/src/Hazelcast.Net.Testing/Remote/Lang.cs @@ -11,11 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -/** - * +/* + * auto-generated * Autogenerated by Thrift Compiler (0.18.0) * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * */ #pragma warning disable IDE0079 // remove unnecessary pragmas diff --git a/src/Hazelcast.Net.Testing/Remote/Member.cs b/src/Hazelcast.Net.Testing/Remote/Member.cs index bfc80f04cd..a83dec7414 100644 --- a/src/Hazelcast.Net.Testing/Remote/Member.cs +++ b/src/Hazelcast.Net.Testing/Remote/Member.cs @@ -11,11 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -/** - * +/* + * auto-generated * Autogenerated by Thrift Compiler (0.18.0) * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * */ using System; using System.Collections; diff --git a/src/Hazelcast.Net.Testing/Remote/RemoteController.cs b/src/Hazelcast.Net.Testing/Remote/RemoteController.cs index 28839fa0d9..d44e493e69 100644 --- a/src/Hazelcast.Net.Testing/Remote/RemoteController.cs +++ b/src/Hazelcast.Net.Testing/Remote/RemoteController.cs @@ -11,11 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -/** - * +/* + * auto-generated * Autogenerated by Thrift Compiler (0.18.0) * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * */ using System; using System.Collections; @@ -95,6 +94,7 @@ public interface IAsync /// /// /// + /// A cancellation token. global::System.Threading.Tasks.Task loginToCloud(string baseUrl, string apiKey, string apiSecret, CancellationToken cancellationToken = default); /// @@ -107,6 +107,7 @@ public interface IAsync /// /// /// + /// A cancellation token. global::System.Threading.Tasks.Task createCloudCluster(string hazelcastVersion, bool isTlsEnabled, CancellationToken cancellationToken = default); /// @@ -117,6 +118,7 @@ public interface IAsync /// @param cloudClusterId -> Id of the cluster /// /// + /// A cancellation token. global::System.Threading.Tasks.Task getCloudCluster(string cloudClusterId, CancellationToken cancellationToken = default); /// @@ -127,6 +129,7 @@ public interface IAsync /// @param cloudClusterId -> Id of the cluster /// /// + /// A cancellation token. global::System.Threading.Tasks.Task stopCloudCluster(string cloudClusterId, CancellationToken cancellationToken = default); /// @@ -137,6 +140,7 @@ public interface IAsync /// @param cloudClusterId /// /// + /// A cancellation token. global::System.Threading.Tasks.Task resumeCloudCluster(string cloudClusterId, CancellationToken cancellationToken = default); /// @@ -147,6 +151,7 @@ public interface IAsync /// @param cloudClusterId /// /// + /// A cancellation token. global::System.Threading.Tasks.Task deleteCloudCluster(string cloudClusterId, CancellationToken cancellationToken = default); global::System.Threading.Tasks.Task executeOnController(string clusterId, string script, global::Hazelcast.Testing.Remote.Lang lang, CancellationToken cancellationToken = default); diff --git a/src/Hazelcast.Net.Testing/Remote/Response.cs b/src/Hazelcast.Net.Testing/Remote/Response.cs index 71cdbb3039..8d57e543d7 100644 --- a/src/Hazelcast.Net.Testing/Remote/Response.cs +++ b/src/Hazelcast.Net.Testing/Remote/Response.cs @@ -11,11 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -/** - * +/* + * auto-generated * Autogenerated by Thrift Compiler (0.18.0) * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * */ using System; using System.Collections; diff --git a/src/Hazelcast.Net.Testing/Remote/ServerException.cs b/src/Hazelcast.Net.Testing/Remote/ServerException.cs index 9f0062a68a..42fb2116f1 100644 --- a/src/Hazelcast.Net.Testing/Remote/ServerException.cs +++ b/src/Hazelcast.Net.Testing/Remote/ServerException.cs @@ -11,11 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -/** - * +/* + * auto-generated * Autogenerated by Thrift Compiler (0.18.0) * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * */ using System; using System.Collections; @@ -51,7 +50,7 @@ public partial class ServerException : TException, TBase { private string _message; - public string Message + public new string Message { get { diff --git a/src/Hazelcast.Net.Tests/CP/CPMapTests.cs b/src/Hazelcast.Net.Tests/CP/CPMapTests.cs index aa020986db..c647a74034 100644 --- a/src/Hazelcast.Net.Tests/CP/CPMapTests.cs +++ b/src/Hazelcast.Net.Tests/CP/CPMapTests.cs @@ -31,7 +31,6 @@ namespace Hazelcast.Tests.CP; public class CPMapTests : MultiMembersRemoteTestBase { private string _defaultMapName = "myMap"; - private string _groupName = "group1"; private List _members = new(); public IHazelcastClient Client { get; private set; } diff --git a/src/Hazelcast.Net.Tests/Clustering/FailoverTests.cs b/src/Hazelcast.Net.Tests/Clustering/FailoverTests.cs index 66e183d0d5..cc656d0b4f 100644 --- a/src/Hazelcast.Net.Tests/Clustering/FailoverTests.cs +++ b/src/Hazelcast.Net.Tests/Clustering/FailoverTests.cs @@ -775,7 +775,7 @@ await AssertEx.SucceedsEventually( } /// - /// Asserts that the client is connected to the expected cluster & can access the specified map. + /// Asserts that the client is connected to the expected cluster & can access the specified map. /// private async Task AssertCluster(IHazelcastClient client, string expectedClusterName, IHMap map) { diff --git a/src/Hazelcast.Net.Tests/Clustering/FailoverTests2.cs b/src/Hazelcast.Net.Tests/Clustering/FailoverTests2.cs index 06ac57da3f..8ea0c153ac 100644 --- a/src/Hazelcast.Net.Tests/Clustering/FailoverTests2.cs +++ b/src/Hazelcast.Net.Tests/Clustering/FailoverTests2.cs @@ -457,7 +457,7 @@ private async ValueTask ServerHandler(ClientRequest request) } /// - /// Asserts that the client is connected to the expected cluster & can access the specified map. + /// Asserts that the client is connected to the expected cluster & can access the specified map. /// public async Task AssertCluster(IHazelcastClient client, string expectedClusterName, IHMap map) { diff --git a/src/Hazelcast.Net.Tests/Models/HazelcastDataTypesTests.cs b/src/Hazelcast.Net.Tests/Models/HazelcastDataTypesTests.cs index 9ca7005f23..3096411366 100644 --- a/src/Hazelcast.Net.Tests/Models/HazelcastDataTypesTests.cs +++ b/src/Hazelcast.Net.Tests/Models/HazelcastDataTypesTests.cs @@ -245,7 +245,9 @@ public void LocalDate(string stringValue) Assert.AreEqual(dateTimeValue.ToString("yyyy-MM-dd"), localDateValue.ToString()); Assert.False(refLocalDateVal!= localDateValue); // ReSharper disable once EqualExpressionComparison +#pragma warning disable CS1718 Assert.True(localDateValue == localDateValue); +#pragma warning restore CS1718 Assert.True(localDateValue.Equals(refLocalDateVal)); Assert.True(localDateValue.Equals((object)refLocalDateVal)); } @@ -331,9 +333,11 @@ public void OffsetDateTime(string stringValue) ); // ReSharper disable once EqualExpressionComparison +#pragma warning disable CS1718 Assert.False(offsetDateTimeValue != offsetDateTimeValue); // ReSharper disable once EqualExpressionComparison Assert.True(offsetDateTimeValue == offsetDateTimeValue); +#pragma warning restore CS1718 Assert.True(offsetDateTimeValue.Equals(offsetDateTimeValue)); Assert.True(offsetDateTimeValue.Equals((object)offsetDateTimeValue)); } diff --git a/src/Hazelcast.Net.Tests/Networking/ClientSslTestBase.cs b/src/Hazelcast.Net.Tests/Networking/ClientSslTestBase.cs index 99dd3f0623..68d41a7a16 100644 --- a/src/Hazelcast.Net.Tests/Networking/ClientSslTestBase.cs +++ b/src/Hazelcast.Net.Tests/Networking/ClientSslTestBase.cs @@ -90,8 +90,6 @@ namespace Hazelcast.Tests.Networking { public abstract class ClientSslTestBase : RemoteTestBase { - private IDisposable _console; - protected static TimeSpan TestTimeout = TimeSpan.FromSeconds(30); #if SSLCERTS_JAVA @@ -252,8 +250,6 @@ public void SetUp() [TearDown] public async Task TearDown() { - _console?.Dispose(); - // terminate & remove member if (RcMember != null) { diff --git a/src/Hazelcast.Net.Tests/Serialization/Compact/RemoteToObjectFirstTests.cs b/src/Hazelcast.Net.Tests/Serialization/Compact/RemoteToObjectFirstTests.cs index 35fc034d6c..14262f5302 100644 --- a/src/Hazelcast.Net.Tests/Serialization/Compact/RemoteToObjectFirstTests.cs +++ b/src/Hazelcast.Net.Tests/Serialization/Compact/RemoteToObjectFirstTests.cs @@ -45,7 +45,7 @@ public async Task TearDown() } } - private static string GetRandomName(string prefix) => $"{prefix}-{Guid.NewGuid().ToString("N")[..7]}"; + private new static string GetRandomName(string prefix) => $"{prefix}-{Guid.NewGuid().ToString("N")[..7]}"; private async Task SetUpCluster(Schema schema) { diff --git a/src/Hazelcast.Net.Tests/Serialization/Objects/KitchenSinkPortable.cs b/src/Hazelcast.Net.Tests/Serialization/Objects/KitchenSinkPortable.cs index 298096e38c..f3aa06ac4d 100644 --- a/src/Hazelcast.Net.Tests/Serialization/Objects/KitchenSinkPortable.cs +++ b/src/Hazelcast.Net.Tests/Serialization/Objects/KitchenSinkPortable.cs @@ -100,10 +100,10 @@ public override bool Equals(object obj) /// /// Generates a portable object with data. Also used to size strings in the string arrays. - /// n(where 0 - /// arraySize">Size of for array type fields + /// Size of for array type fields /// public static KitchenSinkPortable Generate(int arraySize = 5) { diff --git a/src/Hazelcast.Net.Win32/Security/KerberosTokenProvider.cs b/src/Hazelcast.Net.Win32/Security/KerberosTokenProvider.cs index 3c2a085fd1..1f3afe3404 100644 --- a/src/Hazelcast.Net.Win32/Security/KerberosTokenProvider.cs +++ b/src/Hazelcast.Net.Win32/Security/KerberosTokenProvider.cs @@ -29,6 +29,7 @@ public class KerberosTokenProvider : IKerberosTokenProvider // // and that same code works both for .NET Framework and .NET Core + /// Gets a Kerberos token for the specified service principal name. public byte[] GetToken(string spn, string username, string password, string domain) { SspiContext context; diff --git a/src/Hazelcast.Net.Win32/Security/Win32/CredentialHandle.cs b/src/Hazelcast.Net.Win32/Security/Win32/CredentialHandle.cs index bdf089ca0d..14570fa4c6 100644 --- a/src/Hazelcast.Net.Win32/Security/Win32/CredentialHandle.cs +++ b/src/Hazelcast.Net.Win32/Security/Win32/CredentialHandle.cs @@ -44,15 +44,19 @@ internal unsafe override CredentialHandle Structify() } } + /// Represents a Windows SSPI credential handle. public class CredentialHandle : SafeHandle { + /// Initializes a new instance of the class. public unsafe CredentialHandle(void* cred) : base(new IntPtr(cred), true) { } + /// public override bool IsInvalid => base.handle == IntPtr.Zero; + /// protected override bool ReleaseHandle() { return true; diff --git a/src/Hazelcast.Net/CP/ClusterCPGroups.cs b/src/Hazelcast.Net/CP/ClusterCPGroups.cs index 1c1da31d55..38fead9491 100644 --- a/src/Hazelcast.Net/CP/ClusterCPGroups.cs +++ b/src/Hazelcast.Net/CP/ClusterCPGroups.cs @@ -79,7 +79,7 @@ public void SetGroups(long version, ICollection groups, IList MapCPtoAPUuids(IList> cpToApUuids, ICollection groupInfos) + private static Dictionary MapCPtoAPUuids(IList> cpToApUuids, ICollection groupInfos) { var mapIds = new Dictionary(); diff --git a/src/Hazelcast.Net/Clustering/Authenticator.cs b/src/Hazelcast.Net/Clustering/Authenticator.cs index fc34e7bcf0..8999513b70 100644 --- a/src/Hazelcast.Net/Clustering/Authenticator.cs +++ b/src/Hazelcast.Net/Clustering/Authenticator.cs @@ -99,7 +99,9 @@ public async ValueTask AuthenticateAsync(MemberConnection /// /// Authenticates a TPC connection. /// +#pragma warning disable CA1822 // CA1822: method may gain instance access in the future public async ValueTask AuthenticateTpcAsync(MemberConnection client, ClientMessageConnection connection, Guid clientId, byte[] token, CancellationToken cancellationToken) +#pragma warning restore CA1822 { var message = TpcClientChannelAuthenticationCodec.EncodeRequest(clientId, token); message.InvocationFlags |= InvocationFlags.InvokeWhenNotConnected; diff --git a/src/Hazelcast.Net/Clustering/ClusterConnections.cs b/src/Hazelcast.Net/Clustering/ClusterConnections.cs index 60d19b6cda..a663eba4a2 100644 --- a/src/Hazelcast.Net/Clustering/ClusterConnections.cs +++ b/src/Hazelcast.Net/Clustering/ClusterConnections.cs @@ -966,7 +966,7 @@ void RemoveCompletion() RemoveCompletion(); return connection; } - private async Task ThrowInvalidPartitionGroup(MemberConnection connection) + private static async Task ThrowInvalidPartitionGroup(MemberConnection connection) { await connection.DisposeAsync().CfAwait(); throw new InvalidPartitionGroupException("No member group is received from server as partition group." + diff --git a/src/Hazelcast.Net/Clustering/ClusterMembers.cs b/src/Hazelcast.Net/Clustering/ClusterMembers.cs index 76526e5691..3e8d333821 100644 --- a/src/Hazelcast.Net/Clustering/ClusterMembers.cs +++ b/src/Hazelcast.Net/Clustering/ClusterMembers.cs @@ -151,7 +151,7 @@ public ClusterMembers(ClusterState clusterState, TerminateConnections terminateC // is considered connected - but then, the "match" logic cannot work and must be refactored. // but, it's something that no other client offers - decision = disable it entirely for now. - private bool MatchMemberAddress + private static bool MatchMemberAddress //=> _clusterState.Options.Networking.SmartRouting || _clusterState.Options.Networking.Cloud.Enabled; => false; @@ -161,8 +161,10 @@ private bool MatchMemberAddress public ClusterCPGroups ClusterCPGroups => _cpGroups; // see notes above, if matching then addresses must match, else anything matches +#pragma warning disable CA1822 // CA1822: relies on MatchMemberAddress which may become non-constant public bool IsMemberAddress(MemberInfo member, NetworkAddress address) => !MatchMemberAddress || member.ConnectAddress == address; +#pragma warning restore CA1822 // Gets filtered members for multi member connections. public ISubsetClusterMembers SubsetClusterMembers => _subsetClusterMembers; diff --git a/src/Hazelcast.Net/Clustering/ClusterMessaging.cs b/src/Hazelcast.Net/Clustering/ClusterMessaging.cs index 85eb37c863..12feef45bf 100644 --- a/src/Hazelcast.Net/Clustering/ClusterMessaging.cs +++ b/src/Hazelcast.Net/Clustering/ClusterMessaging.cs @@ -196,7 +196,12 @@ private Task SendAsyncInternal(ClientMessage message, MemberConne /// /// Sends an invocation request message. /// - /// The invocation. + /// The message to send. + /// An optional specific connection to use. + /// An optional target partition identifier. + /// An optional target member identifier. + /// A correlation identifier. + /// Whether to raise events. /// A cancellation token. /// The response message. private async Task SendAsyncInternal(ClientMessage message, MemberConnection connectionGiven, int targetPartitionId, diff --git a/src/Hazelcast.Net/Clustering/MemberPartitionGroup.cs b/src/Hazelcast.Net/Clustering/MemberPartitionGroup.cs index b9a3f3bc1f..f9308e3fb1 100644 --- a/src/Hazelcast.Net/Clustering/MemberPartitionGroup.cs +++ b/src/Hazelcast.Net/Clustering/MemberPartitionGroup.cs @@ -105,7 +105,7 @@ internal MemberGroups GetMostOverlappedGroup(Guid clusterId, Guid memberIdOfGrou } // internal for testing - internal MemberGroups GetBiggestGroup(MemberGroups newGroup) + internal static MemberGroups GetBiggestGroup(MemberGroups newGroup) { var maxCount = int.MinValue; HashSet biggestGroup = null; diff --git a/src/Hazelcast.Net/Configuration/DynamicOptions.cs b/src/Hazelcast.Net/Configuration/DynamicOptions.cs index 63db717b2e..a2aebb1691 100644 --- a/src/Hazelcast.Net/Configuration/DynamicOptions.cs +++ b/src/Hazelcast.Net/Configuration/DynamicOptions.cs @@ -134,7 +134,7 @@ private List MapQueryCacheConfigs(List MapListenerConfigs(List listenerConfigs) + private static List MapListenerConfigs(List listenerConfigs) where T : ListenerOptions { if (listenerConfigs == null || listenerConfigs.Count == 0) return null; diff --git a/src/Hazelcast.Net/Hazelcast.Net.csproj b/src/Hazelcast.Net/Hazelcast.Net.csproj index ec6fa1638c..41f82a0c1c 100644 --- a/src/Hazelcast.Net/Hazelcast.Net.csproj +++ b/src/Hazelcast.Net/Hazelcast.Net.csproj @@ -21,6 +21,9 @@ true AllEnabledByDefault + + + $(NoWarn);CA1873;CA1865 diff --git a/src/Hazelcast.Net/Messaging/Frame.cs b/src/Hazelcast.Net/Messaging/Frame.cs index 9b95c3d8df..9f385bc6f6 100644 --- a/src/Hazelcast.Net/Messaging/Frame.cs +++ b/src/Hazelcast.Net/Messaging/Frame.cs @@ -74,6 +74,7 @@ public Frame(Memory memoryBytes, FrameFlags flags = FrameFlags.Default) /// The array rented from . /// The number of valid bytes starting at index 0. /// The frame flags. + /// The pool to return the array to when done; or null if none. public Frame(byte[] rentedArray, int length, FrameFlags flags, ArrayPool pool = null) { Flags = flags; diff --git a/src/Hazelcast.Net/Models/SingleVectorValues.cs b/src/Hazelcast.Net/Models/SingleVectorValues.cs index 3484538d73..46432bbd53 100644 --- a/src/Hazelcast.Net/Models/SingleVectorValues.cs +++ b/src/Hazelcast.Net/Models/SingleVectorValues.cs @@ -14,6 +14,9 @@ using System.Linq; namespace Hazelcast.Models { + /// + /// Represents a single dense float vector value. + /// public class SingleVectorValues : VectorValues { internal SingleVectorValues() { } @@ -21,6 +24,8 @@ internal SingleVectorValues(float[] vector) { Vector = vector; } + + /// Gets the vector data. public float[] Vector { get; } diff --git a/src/Hazelcast.Net/Protocol/Codecs/CPSessionCloseSessionCodec.cs b/src/Hazelcast.Net/Protocol/Codecs/CPSessionCloseSessionCodec.cs index 22685a9a7e..5b4680f7c7 100644 --- a/src/Hazelcast.Net/Protocol/Codecs/CPSessionCloseSessionCodec.cs +++ b/src/Hazelcast.Net/Protocol/Codecs/CPSessionCloseSessionCodec.cs @@ -102,7 +102,7 @@ public sealed class ResponseParameters { /// - /// true if the session is found&closed, + /// true if the session is found & closed, /// false otherwise. /// public bool Response { get; set; } diff --git a/src/Hazelcast.Net/Protocol/Models/VectorPairHolder.cs b/src/Hazelcast.Net/Protocol/Models/VectorPairHolder.cs index 8e725e43d2..90678d1191 100644 --- a/src/Hazelcast.Net/Protocol/Models/VectorPairHolder.cs +++ b/src/Hazelcast.Net/Protocol/Models/VectorPairHolder.cs @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +using System; using System.Linq; namespace Hazelcast.Protocol.Models { @@ -37,12 +38,12 @@ public override bool Equals(object obj) if (this == obj) return true; if (obj == null || GetType() != obj.GetType()) return false; var that = (VectorPairHolder) obj; - return Name.Equals(that.Name) && Vector.SequenceEqual(that.Vector); + return Name.Equals(that.Name, StringComparison.Ordinal) && Vector.SequenceEqual(that.Vector); } public override int GetHashCode() { - var result = 31 * Name.GetHashCode(); + var result = 31 * Name.GetHashCode(StringComparison.Ordinal); result = 31 * result + Type.GetHashCode(); result = 31 * result + Vector.GetHashCode(); return result; diff --git a/src/Hazelcast.Net/Serialization/ObjectDataOutput.cs b/src/Hazelcast.Net/Serialization/ObjectDataOutput.cs index 3255a1f176..bd467b60d1 100644 --- a/src/Hazelcast.Net/Serialization/ObjectDataOutput.cs +++ b/src/Hazelcast.Net/Serialization/ObjectDataOutput.cs @@ -28,7 +28,7 @@ internal partial class ObjectDataOutput : IObjectDataOutput, ICanHaveSchemas, ID private int _prefixBias; // bytes reserved at start of buffer via ReservePrefix private HashSet _schemaIds; private IBufferPool _bufferPool; - private bool _initialized = false; + private bool _initialized; internal ObjectDataOutput(int initialBufferSize, IWriteObjectsToObjectDataOutput objectsReaderWriter, Endianness endianness, IBufferPool bufferPool) { _initialBufferSize = initialBufferSize; diff --git a/src/Hazelcast.Net/Serialization/SerializationService.cs b/src/Hazelcast.Net/Serialization/SerializationService.cs index a513f6df80..83df5a6eed 100644 --- a/src/Hazelcast.Net/Serialization/SerializationService.cs +++ b/src/Hazelcast.Net/Serialization/SerializationService.cs @@ -129,7 +129,9 @@ internal SerializationService( // then object itself implements the (de) serialization methods var dataSerializer = new DataSerializer(hooks.Hooks, dataSerializableFactories, loggerFactory); _dataSerializerAdapter = CreateSerializerAdapter(dataSerializer); +#pragma warning disable CA2263 RegisterConstantSerializer(_dataSerializerAdapter, typeof(IIdentifiedDataSerializable)); +#pragma warning restore CA2263 // Registers the constant 'compact serializer', which implements compact serialization. // Own the ISchemas instance and make sure to dispose it @@ -172,7 +174,9 @@ internal SerializationService( _portableContext = new PortableContext(this, portableVersion); _portableSerializer = new PortableSerializer(_portableContext, portableFactories); _portableSerializerAdapter = CreateSerializerAdapter(_portableSerializer); +#pragma warning disable CA2263 RegisterConstantSerializer(_portableSerializerAdapter, typeof(IPortable)); +#pragma warning restore CA2263 RegisterPortableClassDefinitions(portableClassDefinitions, validatePortableClassDefinitions); // Registers the global serializer, if any.