Update MRI projects for Aluminium
[netconf.git] / netconf / mdsal-netconf-connector / src / main / java / org / opendaylight / netconf / mdsal / connector / ops / AbstractEdit.java
index 209e4ec01aee567558a51d0a63560d804d052741..2a99755c4e3f6bcc11a79f56bfcaf38fc91660eb 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.mdsal.connector.ops;
 
 import com.google.common.collect.ImmutableMap;
@@ -13,6 +12,7 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Optional;
 import javax.xml.transform.dom.DOMSource;
 import org.opendaylight.netconf.api.DocumentedException;
 import org.opendaylight.netconf.api.DocumentedException.ErrorSeverity;
@@ -65,7 +65,7 @@ abstract class AbstractEdit extends AbstractConfigOperation {
 
     protected DataSchemaNode getSchemaNodeFromNamespace(final String namespace, final XmlElement element)
         throws DocumentedException {
-        final Iterator<Module> it;
+        final Iterator<? extends Module> it;
         try {
             // Returns module with newest revision since findModuleByNamespace returns a set of modules and we only
             // need the newest one
@@ -82,11 +82,13 @@ abstract class AbstractEdit extends AbstractConfigOperation {
         }
 
         final Module module = it.next();
-        final java.util.Optional<DataSchemaNode> schemaNode =
-            module.findDataChildByName(QName.create(module.getQNameModule(), element.getName()));
+        final String elementName = element.getName();
+        final Optional<DataSchemaNode> schemaNode = module.findDataChildByName(QName.create(module.getQNameModule(),
+                    element.getName()));
         if (!schemaNode.isPresent()) {
             throw new DocumentedException(
-                "Unable to find node with namespace: " + namespace + "in module: " + module.toString(),
+                "Unable to find node " + elementName + " with namespace: " + namespace + "in module: "
+                    + module.toString(),
                 ErrorType.APPLICATION,
                 ErrorTag.UNKNOWN_NAMESPACE,
                 ErrorSeverity.ERROR);