BUG-3363: code optimization and cleanup - Fix eclipse warnings 86/22286/2
authorRobert Varga <rovarga@cisco.com>
Sat, 6 Jun 2015 01:11:13 +0000 (03:11 +0200)
committermichal rehak <mirehak@cisco.com>
Wed, 10 Jun 2015 15:35:30 +0000 (15:35 +0000)
Unused imports, missing serialVersionUID, unneeded cast. Formatting
changes courtesy autosave cleanup actions.

Change-Id: If85ef69d426b129170d5b55d0bd6893a901d50cc
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit d25cd407fd8f5d038349db4bb2407d023afe3150)

openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/registry/flow/FlowRegistryException.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/karaf/ShowSessionStatsCommandProvider.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/registry/flow/FlowRegistryKeyFactory.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/PortUpdateTranslator.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/api/openflow/device/RpcManagerImplTest.java

index a29872698729c4b9194bdd2a4bf3c6b0904fafac..dfacba9a0f4fbb653242b3ba8a148284750cc5f7 100644 (file)
@@ -13,6 +13,7 @@ package org.opendaylight.openflowplugin.api.openflow.registry.flow;
  */
 @Deprecated
 public class FlowRegistryException extends Exception {
+    private static final long serialVersionUID = 7514092745206029217L;
 
     public FlowRegistryException(final String message) {
         super(message);
index 8cca35254ab0cddae181a36052995f965c3e0a45..70f23afdb4947a1ac8c95a4341be62149f45b55e 100644 (file)
@@ -24,7 +24,6 @@ import org.opendaylight.openflowplugin.impl.connection.listener.ConnectionReadyL
 import org.opendaylight.openflowplugin.impl.connection.listener.HandshakeListenerImpl;
 import org.opendaylight.openflowplugin.impl.connection.listener.OpenflowProtocolListenerInitialImpl;
 import org.opendaylight.openflowplugin.impl.connection.listener.SystemNotificationsListenerImpl;
-import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics;
 import org.opendaylight.openflowplugin.openflow.md.core.ErrorHandlerSimpleImpl;
 import org.opendaylight.openflowplugin.openflow.md.core.HandshakeManagerImpl;
 import org.opendaylight.openflowplugin.openflow.md.core.ThreadPoolLoggingExecutor;
@@ -40,7 +39,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
 
     private static final Logger LOG = LoggerFactory.getLogger(ConnectionManagerImpl.class);
     private static final int HELLO_LIMIT = 20;
-    private boolean bitmapNegotiationEnabled = true;
+    private final boolean bitmapNegotiationEnabled = true;
     private DeviceConnectedHandler deviceConnectedHandler;
 
     @Override
index c7733dca3f01ddcd7da2cad24a079f515dfdeba9..732957cc6d1b95043fe603e10394723e7da7c551 100644 (file)
@@ -12,8 +12,6 @@ import java.io.PrintStream;
 import java.util.List;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency;
-import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl;
 import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics;
 
 /**
index 08f128e5b5d298705a1c3cd7d9b3ca1970897cec..08f8d85e456dc049ad9a265836c7a654fc699ae9 100644 (file)
@@ -25,7 +25,7 @@ public class FlowRegistryKeyFactory {
     public FlowRegistryKeyFactory() {
     }
 
-    public static FlowRegistryKey create(Flow flow) {
+    public static FlowRegistryKey create(final Flow flow) {
         return new FlowRegistryKeyDto(flow);
     }
 
@@ -45,21 +45,31 @@ public class FlowRegistryKeyFactory {
 
         @Override
         public boolean equals(final Object o) {
-            if (this == o) return true;
-            if (o == null || getClass() != o.getClass()) return false;
+            if (this == o) {
+                return true;
+            }
+            if (o == null || getClass() != o.getClass()) {
+                return false;
+            }
 
             final FlowRegistryKeyDto that = (FlowRegistryKeyDto) o;
 
-            if (priority != that.priority) return false;
-            if (tableId != that.tableId) return false;
-            if (!match.equals(that.match)) return false;
+            if (priority != that.priority) {
+                return false;
+            }
+            if (tableId != that.tableId) {
+                return false;
+            }
+            if (!match.equals(that.match)) {
+                return false;
+            }
 
             return true;
         }
 
         @Override
         public int hashCode() {
-            int result = (int) tableId;
+            int result = tableId;
             result = 31 * result + priority;
             result = 31 * result + match.hashCode();
             return result;
index 2f8494c8b7687511ef762f23bf4a393964a559dd..847fc003d97c1bbf2df9a50526cf68c76be3e68e 100644 (file)
@@ -14,7 +14,6 @@ import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
 import org.opendaylight.openflowplugin.openflow.md.util.PortTranslatorUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.Queue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortNumberUni;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
 
index 562f7de5a9e253acfe438c09a1d19a62edf2624c..82d5c55fbadf9996e5fc20574ddbf33c2a15059e 100644 (file)
@@ -21,7 +21,6 @@ import org.mockito.Mock;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
-import org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
 import org.opendaylight.openflowplugin.impl.rpc.RpcContextImpl;
 import org.opendaylight.openflowplugin.impl.rpc.RpcManagerImpl;