bug 433 NPE in onGlobalContextUpdated of ControllerContext class 12/5412/1
authorJozef Gloncak <jgloncak@cisco.com>
Wed, 19 Feb 2014 12:32:51 +0000 (13:32 +0100)
committerJozef Gloncak <jgloncak@cisco.com>
Wed, 19 Feb 2014 12:38:38 +0000 (13:38 +0100)
Input parameter of type SchemaContext of method onGlobalContextUpdated is
now checked if is different from null to be able to call getOperations method.
In addition clearing of map of rpcs was added.

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

index f1d412cdb0082960aa02f93dcffbc3b5ba0ca6e3..482dcf8e8b37e5427c2470122bae9a15e3189a84 100644 (file)
@@ -603,10 +603,13 @@ class ControllerContext implements SchemaServiceListener {
     }
 
     override onGlobalContextUpdated(SchemaContext context) {
     }
 
     override onGlobalContextUpdated(SchemaContext context) {
-        this.globalSchema = context;
-        for (operation : context.operations) {
-            val qname = operation.QName;
-            qnameToRpc.put(qname, operation);
+        if (context !== null) {
+            qnameToRpc.clear
+            this.globalSchema = context;
+            for (operation : context.operations) {
+                val qname = operation.QName;
+                qnameToRpc.put(qname, operation);
+            }
         }
     }
 
         }
     }