Merge "Added more granular error reporting during commit validation."
authorEd Warnicke <eaw@cisco.com>
Thu, 12 Dec 2013 14:41:01 +0000 (14:41 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 12 Dec 2013 14:41:01 +0000 (14:41 +0000)
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/yangtools/yang/util/YangSchemaUtils.java

index 44ee2a31b0d2135c41967867398aed18e3893347..3ff1d1d6cbafa87a7479945965542eaf8235368e 100644 (file)
@@ -80,10 +80,11 @@ public class YangSchemaUtils {
                 checkArgument(!iterator.hasNext(), "Path nests inside leaf node, which is not allowed.");
                 return currentNode;
             }
+            checkState(currentNode != null, "Current node should not be null for %s",path);
         }
+        checkState(previous instanceof DataSchemaNode, "Schema node for %s should be instance of DataSchemaNode. Found %s",path,previous);
         return (DataSchemaNode) previous;
     }
-    
 
     private static DataSchemaNode searchInChoices(DataNodeContainer node, QName arg) {
         Set<DataSchemaNode> children = node.getChildNodes();