X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frest%2Fimpl%2FXmlNormalizedNodeBodyReader.java;h=1933c91e6bd65d210c3b5cf0375f2c4460eb6db3;hb=ab8ed1ce780ed2019ddeb4a1b890e7e5f442fe90;hp=d2c75f7e0ccfb6b8f4d82d78e7ea0b0a1e0c7971;hpb=2660b697228bb3e708a556b53e06a89d5ea00440;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlNormalizedNodeBodyReader.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlNormalizedNodeBodyReader.java index d2c75f7e0c..1933c91e6b 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlNormalizedNodeBodyReader.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlNormalizedNodeBodyReader.java @@ -142,6 +142,10 @@ public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPro if (isPost()) { final Deque foundSchemaNodes = findPathToSchemaNodeByName(schemaNode, docRootElm); + if (foundSchemaNodes.isEmpty()) { + throw new IllegalStateException(String.format("Child \"%s\" was not found in parent schema node \"%s\"", + docRootElm, schemaNode.getQName())); + } while (!foundSchemaNodes.isEmpty()) { final Object child = foundSchemaNodes.pop(); if (child instanceof AugmentationSchema) {