From: Jozef Gloncak Date: Wed, 19 Feb 2014 12:32:51 +0000 (+0100) Subject: bug 433 NPE in onGlobalContextUpdated of ControllerContext class X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~402^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=da0c60451f87b04b2f3b9c213b54edfb4ce94c9f bug 433 NPE in onGlobalContextUpdated of ControllerContext class 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 --- diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend index f1d412cdb0..482dcf8e8b 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/ControllerContext.xtend @@ -603,10 +603,13 @@ class ControllerContext implements SchemaServiceListener { } 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); + } } }