X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fcodegen%2Fimpl%2FRuntimeCodeGenerator.xtend;h=834eb4f5fb357b65ae7ed90b6e986ea7c2474a0e;hp=00c9f1eb91a14f7f1df97a73bc871cac9e918058;hb=23054c2ec3fa8166838f9d18af452e30acefd9d5;hpb=e64d758b45360b2ed8b7d8967fc1c7caaa7aa58f diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend index 00c9f1eb91..834eb4f5fb 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend @@ -82,6 +82,12 @@ class RuntimeCodeGenerator extends AbstractRuntimeCodeGenerator { val rpcMeta = metadata.getRpcMethod(name); val bodyTmp = ''' { + if($1 == null) { + throw new IllegalArgumentException("RPC input must not be null and must contain a value for field «rpcMeta.inputRouteGetter.name»"); + } + if($1.«rpcMeta.inputRouteGetter.name»() == null) { + throw new IllegalArgumentException("Field «rpcMeta.inputRouteGetter.name» must not be null"); + } final «InstanceIdentifier.name» identifier = $1.«rpcMeta.inputRouteGetter.name»()«IF rpcMeta. routeEncapsulated».getValue()«ENDIF»; «supertype.name» instance = («supertype.name») «rpcMeta.context.routingTableField».get(identifier);