ControllerContext.dataNodeChildByQName method refactoring 06/9306/3
authorJozef Gloncak <jgloncak@cisco.com>
Fri, 25 Jul 2014 05:48:29 +0000 (07:48 +0200)
committerJozef Gloncak <jgloncak@cisco.com>
Fri, 1 Aug 2014 07:08:20 +0000 (07:08 +0000)
ControllerContext.dataNodeChildByQName() is used only in childByQName()
methods with DataNodeContainer input parameters:
- ContainerSchemaNode
- ListSchemaNode
- Module
Therefore child node of these DataNodeContainers can't be ChoiceCaseNode
(because it can be only child node of ChoiceNode)
and original branch >if (node instanceof ChoiceCaseNode)< couldn't be
executed.
I think that it was typo.

Change-Id: Ieb85ad8acaf047b47813542d8968c399a4e30b50
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.java

index dad7a2cda2ff3f647d58d66fcd6a37dd36b10c62..f8bcbe3c616ab7910f1d2346543f898c8548cdac 100644 (file)
@@ -508,9 +508,9 @@ public class ControllerContext implements SchemaContextListener {
         DataSchemaNode ret = container.getDataChildByName(name);
         if (ret == null) {
             for (final DataSchemaNode node : container.getChildNodes()) {
         DataSchemaNode ret = container.getDataChildByName(name);
         if (ret == null) {
             for (final DataSchemaNode node : container.getChildNodes()) {
-                if ((node instanceof ChoiceCaseNode)) {
-                    final ChoiceCaseNode caseNode = ((ChoiceCaseNode) node);
-                    DataSchemaNode childByQName = ControllerContext.childByQName(caseNode, name);
+                if ((node instanceof ChoiceNode)) {
+                    final ChoiceNode choiceNode = ((ChoiceNode) node);
+                    DataSchemaNode childByQName = ControllerContext.childByQName(choiceNode, name);
                     if (childByQName != null) {
                         return childByQName;
                     }
                     if (childByQName != null) {
                         return childByQName;
                     }