Bug 981: Make sure QName is not null in RPC case. 18/7118/1
authorTony Tkacik <ttkacik@cisco.com>
Fri, 16 May 2014 16:09:05 +0000 (18:09 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Fri, 16 May 2014 16:09:05 +0000 (18:09 +0200)
Change-Id: I7316918102342ce0375cfa6b14e00a6888eed43b
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
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);
         }