Added more granular error reporting during commit validation. 46/3646/1
authorTony Tkacik <ttkacik@cisco.com>
Wed, 11 Dec 2013 15:28:43 +0000 (16:28 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Wed, 11 Dec 2013 15:29:50 +0000 (16:29 +0100)
Change-Id: I96a9f2fdd256e1b394d3a21fbaccf16f7350d316
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
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();