Skip to content

Commit 550b330

Browse files
committed
Address all nullability warnings
1 parent 471ce4b commit 550b330

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

src/NetMQ.Tests/InProcActors/AccountJSON/AccountActorTests.cs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public void AccountActorJsonSendReceiveTests()
1919

2020
var updatedAccount = JsonConvert.DeserializeObject<Account>(actor.ReceiveFrameString());
2121

22+
Assert.NotNull(updatedAccount);
23+
2224
Assert.Equal(10.0m, updatedAccount.Balance);
2325
}
2426
}

src/NetMQ.Tests/InProcActors/AccountJSON/AccountShimHandler.cs

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public void Run(PairSocket shim)
5353

5454
string accountJson = msg[2].ConvertToString();
5555
var account = JsonConvert.DeserializeObject<Account>(accountJson);
56+
Assumes.NotNull(accountAction);
57+
Assumes.NotNull(account);
5658
AmendAccount(accountAction, account);
5759
shim.SendFrame(JsonConvert.SerializeObject(account));
5860
}

src/NetMQ/Core/Patterns/Utils/FairQueueing.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void Activated(Pipe pipe)
9696

9797
public bool Recv(ref Msg msg)
9898
{
99-
return RecvPipe(ref msg, out Pipe _);
99+
return RecvPipe(ref msg, out _);
100100
}
101101

102102
public bool RecvPipe(ref Msg msg, [NotNullWhen(returnValue: true)] out Pipe? pipe)

src/NetMQ/Core/Patterns/Utils/LoadBalancer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void Activated(Pipe pipe)
9494

9595
public bool Send(ref Msg msg)
9696
{
97-
return SendPipe(ref msg, out Pipe _);
97+
return SendPipe(ref msg, out _);
9898
}
9999

100100
public bool SendPipe(ref Msg msg, out Pipe? pipe)

src/NetMQ/NetMQSocket.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,11 @@ internal int GetSocketOption(ZmqSocketOption option)
472472
/// <returns>an object of the given type, that is the value of that option</returns>
473473
/// <exception cref="TerminatingException">The socket has been stopped.</exception>
474474
/// <exception cref="ObjectDisposedException">This object is already disposed.</exception>
475-
[return: MaybeNull]
476-
internal T GetSocketOptionX<T>(ZmqSocketOption option)
475+
internal T? GetSocketOptionX<T>(ZmqSocketOption option)
477476
{
478477
m_socketHandle.CheckDisposed();
479478

480-
return (T)m_socketHandle.GetSocketOptionX(option);
479+
return (T?)m_socketHandle.GetSocketOptionX(option);
481480
}
482481

483482
/// <summary>

src/NetMQ/ThreadSafeSocketOptions.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ internal int GetSocketOption(ZmqSocketOption option)
6969
/// <returns>an object of the given type, that is the value of that option</returns>
7070
/// <exception cref="TerminatingException">The socket has been stopped.</exception>
7171
/// <exception cref="ObjectDisposedException">This object is already disposed.</exception>
72-
[return: MaybeNull]
73-
internal T GetSocketOptionX<T>(ZmqSocketOption option)
72+
internal T? GetSocketOptionX<T>(ZmqSocketOption option)
7473
{
7574
m_socket.CheckDisposed();
76-
return (T)m_socket.GetSocketOptionX(option);
75+
return (T?)m_socket.GetSocketOptionX(option);
7776
}
7877

7978
/// <summary>

0 commit comments

Comments
 (0)