Merge "Fix a few eclipse-reported warnings"
authorEd Warnicke <eaw@cisco.com>
Mon, 10 Feb 2014 23:36:04 +0000 (23:36 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 10 Feb 2014 23:36:04 +0000 (23:36 +0000)
1  2 
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java
opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.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<RpcContextIdentifier, InstanceIdentifier<?>> {
@@@ -53,7 -56,7 +53,7 @@@
  
      private final String name;
  
 -    private ListenerRegistry<GlobalRpcRegistrationListener> globalRpcListeners = ListenerRegistry.create();
 +    private final ListenerRegistry<GlobalRpcRegistrationListener> globalRpcListeners = ListenerRegistry.create();
  
      public String getName() {
          return name;
@@@ -93,7 -96,6 +93,6 @@@
      @Override
      public final <T extends RpcService> T getRpcService(Class<T> type) {
  
-         @SuppressWarnings("unchecked")
          T potentialProxy = (T) publicProxies.get(type);
          if (potentialProxy != null) {
              return potentialProxy;
  
              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);
                  LOG.error("Unhandled exception during invoking listener {}", e);
              }
          }
 -        
 +
      }
  
-     private void notifyListenersRoutedCreated(RpcRouter router) {
+     private void notifyListenersRoutedCreated(RpcRouter<?> router) {
  
          for (ListenerRegistration<RouterInstantiationListener> listener : routerInstantiationListener) {
              try {
      public interface RouterInstantiationListener extends EventListener {
          void onRpcRouterCreated(RpcRouter<?> router);
      }
 -    
 +
      public ListenerRegistration<GlobalRpcRegistrationListener> registerGlobalRpcRegistrationListener(GlobalRpcRegistrationListener listener) {
          return globalRpcListeners.register(listener);
      }
      public interface GlobalRpcRegistrationListener extends EventListener {
          void onGlobalRpcRegistered(Class<? extends RpcService> cls);
          void onGlobalRpcUnregistered(Class<? extends RpcService> cls);
 -        
 +
      }
  
      private class RouteChangeForwarder<T extends RpcService> implements
@@@ -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 <T> RpcResult<T> getRpcResult(boolean successful) {
          RpcResult<T> ret = new RpcResultTO<T>(successful, null, ImmutableList.<RpcError>of());
          return ret;
      }
 -    
 +
      public static <T> RpcResult<T> getRpcResult(boolean successful, T result,
              Collection<RpcError> errors) {
          RpcResult<T> ret = new RpcResultTO<T>(successful, result, errors);
@@@ -32,9 -34,9 +32,9 @@@
      public static <T> RpcResult<T> getRpcResult(boolean successful, Collection<RpcError> errors) {
          return new RpcResultTO<T>(successful, null, errors);
      }
 -    
 +
      private static class RpcResultTO<T> implements RpcResult<T>, Serializable, Immutable {
+         private static final long serialVersionUID = 1L;
          private final Collection<RpcError> errors;
          private final T result;
          private final boolean successful;

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.