Use instanceof patterns in netconf-util
[netconf.git] / netconf / netconf-util / src / main / java / org / opendaylight / netconf / util / NetconfUtil.java
index 59ad61c8fe11c5bf29e944d0d130790c25c7b63a..867c782776c36f1cd372dcade4449e7ef4359d15 100644 (file)
@@ -335,8 +335,8 @@ public final class NetconfUtil {
 
         final Element childElement = data.getOwnerDocument().createElementNS(elementNamespace, nodeType.getLocalName());
         data.appendChild(childElement);
-        if (pathArg instanceof NodeIdentifierWithPredicates) {
-            appendListKeyNodes(childElement, (NodeIdentifierWithPredicates) pathArg);
+        if (pathArg instanceof NodeIdentifierWithPredicates nip) {
+            appendListKeyNodes(childElement, nip);
         }
         for (final PathNode childrenNode : pathArgumentTree.children()) {
             pathArgumentTreeToXmlStructure(childrenNode, childElement);