From: Ed Warnicke Date: Mon, 10 Feb 2014 23:36:04 +0000 (+0000) Subject: Merge "Fix a few eclipse-reported warnings" X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~495 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=509a8a4d570abc3a9a496837617015b1084c2761;hp=-c Merge "Fix a few eclipse-reported warnings" --- 509a8a4d570abc3a9a496837617015b1084c2761 diff --combined opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java index a5da8a0cb1,6844e3845b..e98d5b9942 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java @@@ -7,28 -7,29 +7,28 @@@ */ package org.opendaylight.controller.sal.binding.impl; +import static com.google.common.base.Preconditions.checkState; + import java.util.EventListener; +import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import java.util.HashMap; import java.util.Set; import java.util.WeakHashMap; -import javax.swing.tree.ExpandVetoException; - import org.opendaylight.controller.md.sal.common.api.routing.RouteChange; import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener; import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher; import org.opendaylight.controller.md.sal.common.impl.routing.RoutingUtils; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier; import org.opendaylight.controller.sal.binding.api.rpc.RpcRouter; import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator; import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper; import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder; -import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier; import org.opendaylight.yangtools.concepts.AbstractObjectRegistration; -import org.opendaylight.yangtools.concepts.Identifiable; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.concepts.util.ListenerRegistry; import org.opendaylight.yangtools.yang.binding.BaseIdentity; @@@ -37,6 -38,8 +37,6 @@@ import org.opendaylight.yangtools.yang. import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.google.common.base.Preconditions.*; - public class RpcProviderRegistryImpl implements // RpcProviderRegistry, // RouteChangePublisher> { @@@ -53,7 -56,7 +53,7 @@@ private final String name; - private ListenerRegistry globalRpcListeners = ListenerRegistry.create(); + private final ListenerRegistry globalRpcListeners = ListenerRegistry.create(); public String getName() { return name; @@@ -93,7 -96,6 +93,6 @@@ @Override public final T getRpcService(Class type) { - @SuppressWarnings("unchecked") T potentialProxy = (T) publicProxies.get(type); if (potentialProxy != null) { return potentialProxy; @@@ -106,7 -108,7 +105,7 @@@ potentialProxy = (T) publicProxies.get(type); if (potentialProxy != null) { - return (T) potentialProxy; + return potentialProxy; } T proxy = rpcFactory.getDirectProxyFor(type); LOG.debug("Created {} as public proxy for {} in {}", proxy, type.getSimpleName(), this); @@@ -148,10 -150,10 +147,10 @@@ LOG.error("Unhandled exception during invoking listener {}", e); } } - + } - private void notifyListenersRoutedCreated(RpcRouter router) { + private void notifyListenersRoutedCreated(RpcRouter router) { for (ListenerRegistration listener : routerInstantiationListener) { try { @@@ -193,7 -195,7 +192,7 @@@ public interface RouterInstantiationListener extends EventListener { void onRpcRouterCreated(RpcRouter router); } - + public ListenerRegistration registerGlobalRpcRegistrationListener(GlobalRpcRegistrationListener listener) { return globalRpcListeners.register(listener); } @@@ -201,7 -203,7 +200,7 @@@ public interface GlobalRpcRegistrationListener extends EventListener { void onGlobalRpcRegistered(Class cls); void onGlobalRpcUnregistered(Class cls); - + } private class RouteChangeForwarder implements diff --combined opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java index f7fc714025,5565d8b56d..f303941871 --- a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java +++ b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java @@@ -8,7 -8,9 +8,7 @@@ package org.opendaylight.controller.sal.common.util; import java.io.Serializable; -import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import org.opendaylight.yangtools.concepts.Immutable; import org.opendaylight.yangtools.yang.common.RpcError; @@@ -17,12 -19,12 +17,12 @@@ import org.opendaylight.yangtools.yang. import com.google.common.collect.ImmutableList; public class Rpcs { - + public static RpcResult getRpcResult(boolean successful) { RpcResult ret = new RpcResultTO(successful, null, ImmutableList.of()); return ret; } - + public static RpcResult getRpcResult(boolean successful, T result, Collection errors) { RpcResult ret = new RpcResultTO(successful, result, errors); @@@ -32,9 -34,9 +32,9 @@@ public static RpcResult getRpcResult(boolean successful, Collection errors) { return new RpcResultTO(successful, null, errors); } - + private static class RpcResultTO implements RpcResult, Serializable, Immutable { - + private static final long serialVersionUID = 1L; private final Collection errors; private final T result; private final boolean successful;