Merge "Bug 981: Make sure QName is not null in RPC case."
authorRobert Varga <rovarga@cisco.com>
Sat, 17 May 2014 16:10:45 +0000 (16:10 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 17 May 2014 16:10:45 +0000 (16:10 +0000)
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/BindingSchemaContextUtils.java

index 646f3ea4c3db8b134df8cdfaad836a4ccbaebd8c..078c090d27b37cea49cf8b9957eee9f641ffcba3 100644 (file)
@@ -41,6 +41,9 @@ public class BindingSchemaContextUtils {
             currentContainer = findNotification(ctx, currentQName);
         } else if (BindingReflections.isRpcType(currentArg.getType())) {
             currentContainer = findFirstDataNodeContainerInRpc(ctx, currentArg.getType());
+            if(currentQName == null && currentContainer.isPresent()) {
+                currentQName = ((DataSchemaNode) currentContainer.get()).getQName();
+            }
         } else {
             currentContainer = findDataNodeContainer(ctx, currentQName);
         }