Skip to content

Commit 7dfa024

Browse files
committed
Revert use of CommunityToolkit.Diagnostics for Guard
1 parent f243c42 commit 7dfa024

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

Libraries/Opc.Ua.Server/NodeManager/MasterNodeManager.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
using System.Collections.Generic;
3232
using System.Diagnostics;
3333
using System.Threading;
34-
using CommunityToolkit.Diagnostics;
3534
using Opc.Ua.Server.NodeManager;
3635

3736
namespace Opc.Ua.Server
@@ -53,9 +52,9 @@ public MasterNodeManager(
5352
string dynamicNamespaceUri,
5453
params INodeManager[] additionalManagers)
5554
{
56-
Guard.IsNotNull(server);
57-
Guard.IsNotNull(configuration);
58-
Guard.IsNotNull(mainNodeManagerFactory);
55+
if (server == null) throw new ArgumentNullException(nameof(server));
56+
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
57+
if (mainNodeManagerFactory == null) throw new ArgumentNullException(nameof(mainNodeManagerFactory));
5958

6059
m_server = server;
6160
m_configuration = configuration;

Libraries/Opc.Ua.Server/Opc.Ua.Server.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
</Choose>
3434

3535
<ItemGroup>
36-
<PackageReference Include="CommunityToolkit.Diagnostics" Version="8.4.0" />
3736
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
3837
</ItemGroup>
3938

Libraries/Opc.Ua.Server/Server/ServerInternalData.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
using System.Collections.Generic;
3232
using System.Globalization;
3333
using System.Security.Cryptography.X509Certificates;
34-
using CommunityToolkit.Diagnostics;
3534
using Opc.Ua.Configuration;
3635
using Opc.Ua.Security.Certificates;
3736

@@ -866,8 +865,8 @@ private PropertyState<uint> SetPropertyValue(PropertyState<uint> property, uint
866865
/// <param name="messageContext">Server message context.</param>
867866
public void Initialize(ServerProperties serverDescription, IServiceMessageContext messageContext)
868867
{
869-
Guard.IsNotNull(serverDescription);
870-
Guard.IsNotNull(messageContext);
868+
if (serverDescription == null) throw new ArgumentNullException(nameof(serverDescription));
869+
if (messageContext == null) throw new ArgumentNullException(nameof(messageContext));
871870

872871
lock (m_dataLock)
873872
{
@@ -973,7 +972,7 @@ public void SetServerSecondsTillShutdown(uint timeTillShutdown)
973972
/// <param name="action">Action to perform on the server status object.</param>
974973
public void UpdateServerStatus(Action<ServerStatusValue> action)
975974
{
976-
Guard.IsNotNull(action);
975+
if (action == null) throw new ArgumentNullException(nameof(action));
977976

978977
lock (m_dataLock)
979978
{

0 commit comments

Comments
 (0)