From 77fe94f48ae94bffcb1e46f96d07b7a42dfd16da Mon Sep 17 00:00:00 2001 From: AlinMoldovean Date: Tue, 24 Oct 2017 14:29:02 +0300 Subject: [PATCH] Fixes #275 . A clone of the input NodeId should be created. --- .../Types/BuiltIn/ExpandedNodeId.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Stack/Opc.Ua.Core/Types/BuiltIn/ExpandedNodeId.cs b/Stack/Opc.Ua.Core/Types/BuiltIn/ExpandedNodeId.cs index aa9ee5ab7f..34006a9d0a 100644 --- a/Stack/Opc.Ua.Core/Types/BuiltIn/ExpandedNodeId.cs +++ b/Stack/Opc.Ua.Core/Types/BuiltIn/ExpandedNodeId.cs @@ -18,7 +18,7 @@ using System.Runtime.Serialization; using System.Globalization; namespace Opc.Ua -{ +{ /// /// Extends a node id by adding a complete namespace URI. /// @@ -27,7 +27,7 @@ namespace Opc.Ua /// [DataContract(Namespace = Namespaces.OpcUaXsd)] public class ExpandedNodeId : IComparable, IFormattable - { + { #region Constructors /// /// Initializes the object with default values. @@ -49,7 +49,7 @@ namespace Opc.Ua /// The ExpandedNodeId to copy /// Thrown when the parameter is null public ExpandedNodeId(ExpandedNodeId value) - { + { if (value == null) throw new ArgumentNullException("value"); m_namespaceUri = value.m_namespaceUri; @@ -106,7 +106,7 @@ namespace Opc.Ua if (nodeId != null) { - m_nodeId = nodeId; + m_nodeId = new NodeId(nodeId); } if (!String.IsNullOrEmpty(namespaceUri)) @@ -131,7 +131,7 @@ namespace Opc.Ua if (nodeId != null) { - m_nodeId = nodeId; + m_nodeId = new NodeId(nodeId); } if (!String.IsNullOrEmpty(namespaceUri)) @@ -140,7 +140,7 @@ namespace Opc.Ua } m_serverIndex = serverIndex; - } + } /// /// Initializes a numeric node identifier. @@ -170,7 +170,7 @@ namespace Opc.Ua Initialize(); m_nodeId = new NodeId(value, namespaceIndex); } - + /// /// Initializes a guid node identifier with a namespace URI. /// @@ -186,7 +186,7 @@ namespace Opc.Ua m_nodeId = new NodeId(value); SetNamespaceUri(namespaceUri); } - + /// /// Initializes a string node identifier with a namespace index. /// @@ -230,7 +230,7 @@ namespace Opc.Ua Initialize(); m_nodeId = new NodeId(value); } - + /// /// Initializes a guid node identifier. /// @@ -259,7 +259,7 @@ namespace Opc.Ua Initialize(); m_nodeId = new NodeId(value, namespaceIndex); } - + /// /// Initializes an opaque node identifier with a namespace index. /// @@ -286,7 +286,7 @@ namespace Opc.Ua { Initialize(); m_nodeId = new NodeId(text); - } + } /// /// Sets the private members to default values. @@ -340,7 +340,7 @@ namespace Opc.Ua return IdType.Numeric; } } - + /// /// The node identifier. /// @@ -359,7 +359,7 @@ namespace Opc.Ua return null; } - } + } /// /// The namespace that qualifies the node identifier. @@ -371,7 +371,7 @@ namespace Opc.Ua { get { return m_namespaceUri; } } - + /// /// The index of the server where the node exists. /// @@ -382,7 +382,7 @@ namespace Opc.Ua { get { return m_serverIndex; } } - + /// /// Whether the object represents a Null NodeId. /// @@ -406,7 +406,7 @@ namespace Opc.Ua return NodeId.IsNull(m_nodeId); } } - + /// /// Returns true if the expanded node id is an absolute identifier that contains a namespace URI instead of a server dependent index. /// @@ -425,7 +425,7 @@ namespace Opc.Ua return false; } } - + /// /// Returns the inner node id. ///