From 8a01ebe93fac21b1ae80dcfcc81c21543ec1a687 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 20 Aug 2019 22:56:26 +0200 Subject: [PATCH] Move createProxy() This is a simple internal method, inline it. Change-Id: I5568f95f31c2487441fb19dbf3d33e02de5ada2a Signed-off-by: Robert Varga --- .../impl/BindingDOMRpcServiceAdapter.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMRpcServiceAdapter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMRpcServiceAdapter.java index 5d0039c929..1981bd6cd8 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMRpcServiceAdapter.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMRpcServiceAdapter.java @@ -7,7 +7,8 @@ */ package org.opendaylight.controller.md.sal.binding.impl; -import com.google.common.base.Preconditions; +import static com.google.common.base.Preconditions.checkArgument; + import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; @@ -32,7 +33,9 @@ public class BindingDOMRpcServiceAdapter implements RpcConsumerRegistry { @Override public RpcServiceAdapter load(final Class key) { - return createProxy(key); + checkArgument(BindingReflections.isBindingClass(key)); + checkArgument(key.isInterface(), "Supplied RPC service type must be interface."); + return new RpcServiceAdapter(key, codec, domService); } }); @@ -48,16 +51,10 @@ public class BindingDOMRpcServiceAdapter implements RpcConsumerRegistry { @SuppressWarnings("unchecked") @Override public T getRpcService(final Class rpcService) { - Preconditions.checkArgument(rpcService != null, "Rpc Service needs to be specied."); + checkArgument(rpcService != null, "Rpc Service needs to be specied."); return (T) proxies.getUnchecked(rpcService).getProxy(); } - private RpcServiceAdapter createProxy(final Class key) { - Preconditions.checkArgument(BindingReflections.isBindingClass(key)); - Preconditions.checkArgument(key.isInterface(), "Supplied RPC service type must be interface."); - return new RpcServiceAdapter(key, codec, domService); - } - private static final class Builder extends BindingDOMAdapterBuilder { @Override @@ -71,7 +68,5 @@ public class BindingDOMRpcServiceAdapter implements RpcConsumerRegistry { public Set> getRequiredDelegates() { return ImmutableSet.of(DOMRpcService.class); } - } - } -- 2.36.6