X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fcodegen%2FRuntimeCodeHelper.xtend;h=f0f92da18e5c3b2235eb77a9cf3d0e32b8df371c;hb=3979e330c9f95a898c54a9234f3a07e3b2ae4349;hp=fbd87d17beede977e4efa2b987f077352522481c;hpb=8b6075992f1e18eb678ee4e50e13b3d2d1397a85;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.xtend index fbd87d17be..f0f92da18e 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.xtend +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeHelper.xtend @@ -39,7 +39,7 @@ class RuntimeCodeHelper { public static def void setDelegate(RpcService proxy, RpcService delegate) { val field = proxy.class.getField(DELEGATE_FIELD) if (field == null) throw new UnsupportedOperationException("Unable to set delegate to proxy"); - if (field.type.isAssignableFrom(delegate.class)) { + if (delegate == null || field.type.isAssignableFrom(delegate.class)) { field.set(proxy, delegate) } else throw new IllegalArgumentException("delegate class is not assignable to proxy"); @@ -55,7 +55,7 @@ class RuntimeCodeHelper { public static def void setDelegate(Object proxy, Object delegate) { val field = proxy.class.getField(DELEGATE_FIELD) if (field == null) throw new UnsupportedOperationException("Unable to set delegate to proxy"); - if (field.type.isAssignableFrom(delegate.class)) { + if (delegate == null || field.type.isAssignableFrom(delegate.class)) { field.set(proxy, delegate) } else throw new IllegalArgumentException("delegate class is not assignable to proxy");