From e2427dfa6fcbb1870eed612a45fccea0adec66f9 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Thu, 16 Mar 2023 15:14:05 +1100 Subject: [PATCH 1/6] Bump JetBrains.Annotations package --- src/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index abaddb94..bb679f03 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -6,7 +6,7 @@ - + From 348e82da7b09a660d1d9306a0255c3c637834cd5 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Thu, 16 Mar 2023 15:14:18 +1100 Subject: [PATCH 2/6] Improve incremental build performance --- src/Directory.Build.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index bb679f03..b0c33f55 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,6 +3,8 @@ 8.0 enable + true + true From 07fa3d2ce3d7109e78216a09cd40395ec68a1b30 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Thu, 16 Mar 2023 15:14:27 +1100 Subject: [PATCH 3/6] Use C# 10 --- src/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index b0c33f55..3c107188 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@ - 8.0 + 10 enable true true From e13479ebc57a84ebf46b5d5657f681d3fa692a0d Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Fri, 28 Apr 2023 17:18:48 +1000 Subject: [PATCH 4/6] Fix typo in file name --- .../{ThreafSafeSocketOptions.cs => ThreadSafeSocketOptions.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/NetMQ/{ThreafSafeSocketOptions.cs => ThreadSafeSocketOptions.cs} (100%) diff --git a/src/NetMQ/ThreafSafeSocketOptions.cs b/src/NetMQ/ThreadSafeSocketOptions.cs similarity index 100% rename from src/NetMQ/ThreafSafeSocketOptions.cs rename to src/NetMQ/ThreadSafeSocketOptions.cs From 471ce4be71e82aba48d04de48cca3b2cf159d98b Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Fri, 28 Apr 2023 17:26:17 +1000 Subject: [PATCH 5/6] Bump Microsoft.NETFramework.ReferenceAssemblies package version --- src/NetMQ/NetMQ.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetMQ/NetMQ.csproj b/src/NetMQ/NetMQ.csproj index 71422794..32dcb9fa 100644 --- a/src/NetMQ/NetMQ.csproj +++ b/src/NetMQ/NetMQ.csproj @@ -51,7 +51,7 @@ - + From 550b330f1b4165e2e91d441ca58c0c8245419c64 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Fri, 28 Apr 2023 17:26:35 +1000 Subject: [PATCH 6/6] Address all nullability warnings --- .../InProcActors/AccountJSON/AccountActorTests.cs | 2 ++ .../InProcActors/AccountJSON/AccountShimHandler.cs | 2 ++ src/NetMQ/Core/Patterns/Utils/FairQueueing.cs | 2 +- src/NetMQ/Core/Patterns/Utils/LoadBalancer.cs | 2 +- src/NetMQ/NetMQSocket.cs | 5 ++--- src/NetMQ/ThreadSafeSocketOptions.cs | 5 ++--- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/NetMQ.Tests/InProcActors/AccountJSON/AccountActorTests.cs b/src/NetMQ.Tests/InProcActors/AccountJSON/AccountActorTests.cs index d19a9d6f..e88b451d 100644 --- a/src/NetMQ.Tests/InProcActors/AccountJSON/AccountActorTests.cs +++ b/src/NetMQ.Tests/InProcActors/AccountJSON/AccountActorTests.cs @@ -19,6 +19,8 @@ public void AccountActorJsonSendReceiveTests() var updatedAccount = JsonConvert.DeserializeObject(actor.ReceiveFrameString()); + Assert.NotNull(updatedAccount); + Assert.Equal(10.0m, updatedAccount.Balance); } } diff --git a/src/NetMQ.Tests/InProcActors/AccountJSON/AccountShimHandler.cs b/src/NetMQ.Tests/InProcActors/AccountJSON/AccountShimHandler.cs index c761f523..1869842d 100644 --- a/src/NetMQ.Tests/InProcActors/AccountJSON/AccountShimHandler.cs +++ b/src/NetMQ.Tests/InProcActors/AccountJSON/AccountShimHandler.cs @@ -53,6 +53,8 @@ public void Run(PairSocket shim) string accountJson = msg[2].ConvertToString(); var account = JsonConvert.DeserializeObject(accountJson); + Assumes.NotNull(accountAction); + Assumes.NotNull(account); AmendAccount(accountAction, account); shim.SendFrame(JsonConvert.SerializeObject(account)); } diff --git a/src/NetMQ/Core/Patterns/Utils/FairQueueing.cs b/src/NetMQ/Core/Patterns/Utils/FairQueueing.cs index 89505309..c61d7579 100644 --- a/src/NetMQ/Core/Patterns/Utils/FairQueueing.cs +++ b/src/NetMQ/Core/Patterns/Utils/FairQueueing.cs @@ -96,7 +96,7 @@ public void Activated(Pipe pipe) public bool Recv(ref Msg msg) { - return RecvPipe(ref msg, out Pipe _); + return RecvPipe(ref msg, out _); } public bool RecvPipe(ref Msg msg, [NotNullWhen(returnValue: true)] out Pipe? pipe) diff --git a/src/NetMQ/Core/Patterns/Utils/LoadBalancer.cs b/src/NetMQ/Core/Patterns/Utils/LoadBalancer.cs index d5689757..cf4d3c34 100644 --- a/src/NetMQ/Core/Patterns/Utils/LoadBalancer.cs +++ b/src/NetMQ/Core/Patterns/Utils/LoadBalancer.cs @@ -94,7 +94,7 @@ public void Activated(Pipe pipe) public bool Send(ref Msg msg) { - return SendPipe(ref msg, out Pipe _); + return SendPipe(ref msg, out _); } public bool SendPipe(ref Msg msg, out Pipe? pipe) diff --git a/src/NetMQ/NetMQSocket.cs b/src/NetMQ/NetMQSocket.cs index dfd59f09..05a52ccb 100644 --- a/src/NetMQ/NetMQSocket.cs +++ b/src/NetMQ/NetMQSocket.cs @@ -472,12 +472,11 @@ internal int GetSocketOption(ZmqSocketOption option) /// an object of the given type, that is the value of that option /// The socket has been stopped. /// This object is already disposed. - [return: MaybeNull] - internal T GetSocketOptionX(ZmqSocketOption option) + internal T? GetSocketOptionX(ZmqSocketOption option) { m_socketHandle.CheckDisposed(); - return (T)m_socketHandle.GetSocketOptionX(option); + return (T?)m_socketHandle.GetSocketOptionX(option); } /// diff --git a/src/NetMQ/ThreadSafeSocketOptions.cs b/src/NetMQ/ThreadSafeSocketOptions.cs index 93ee0b5c..d29033a7 100644 --- a/src/NetMQ/ThreadSafeSocketOptions.cs +++ b/src/NetMQ/ThreadSafeSocketOptions.cs @@ -69,11 +69,10 @@ internal int GetSocketOption(ZmqSocketOption option) /// an object of the given type, that is the value of that option /// The socket has been stopped. /// This object is already disposed. - [return: MaybeNull] - internal T GetSocketOptionX(ZmqSocketOption option) + internal T? GetSocketOptionX(ZmqSocketOption option) { m_socket.CheckDisposed(); - return (T)m_socket.GetSocketOptionX(option); + return (T?)m_socket.GetSocketOptionX(option); } ///