Fix various small warnings 74/20574/1
authorRobert Varga <rovarga@cisco.com>
Fri, 15 May 2015 20:53:25 +0000 (22:53 +0200)
committerRobert Varga <rovarga@cisco.com>
Fri, 15 May 2015 22:45:38 +0000 (00:45 +0200)
All of these are reported by eclipse: needlessly raw types, missing
serialversionUUID, methods which can be made static.

Change-Id: I5b71c35ee37167ead77f7baa2e5d6e5c23f99834
Signed-off-by: Robert Varga <rovarga@cisco.com>
27 files changed:
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/ConnectionException.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceContext.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/exception/RequestQuotaExceededException.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/listener/OpenflowMessageListenerFacade.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/rpc/RpcContext.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/statistics/StatisticsContext.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/statistics/StatisticsManager.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ThrottledNotificationsOffererImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/TransactionChainManager.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/listener/MultiMsgCollectorImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/registry/group/DeviceGroupRegistryImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/registry/meter/DeviceMeterRegistryImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/SinglePurposeMultipartReplyTranslator.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsGatheringUtils.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/ofpspecific/MessageIntelligenceAgencyImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/AggregatedFlowStatisticsTranslator.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/PacketReceivedTranslator.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/TranslatorKeyFactory.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/api/openflow/device/RpcManagerImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/common/NodeConnectorTranslatorUtilTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/registry/flow/FlowHashFactoryTest.java

index f20ddf30020d382b8a45683fbb062588bb68d606..7de361215da6d9442209cde731d9f3615e6a8d9f 100644 (file)
@@ -11,9 +11,13 @@ package org.opendaylight.openflowplugin.api;
  * Created by Martin Bobak mbobak@cisco.com on 7/8/14.
  */
 public class ConnectionException extends Exception {
+    private static final long serialVersionUID = 1L;
 
-    public ConnectionException(String message){
+    public ConnectionException(final String message) {
         super(message);
     }
 
+    public ConnectionException(final String message, final Throwable cause) {
+        super(message, cause);
+    }
 }
index d2d860f169799332f86c189d740fd88a20239506..3d9f3bd917ef5658b914ae18e3609644840f52e4 100644 (file)
@@ -22,7 +22,6 @@ import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceReplyP
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.MessageHandler;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.MultiMsgCollector;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.OutstandingMessageExtractor;
-import org.opendaylight.openflowplugin.api.openflow.device.listener.OpenflowMessageListenerFacade;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.DeviceFlowRegistry;
 import org.opendaylight.openflowplugin.api.openflow.registry.group.DeviceGroupRegistry;
 import org.opendaylight.openflowplugin.api.openflow.registry.meter.DeviceMeterRegistry;
index cae8a8515037aef768563c4df5c5c86cd7b3933f..21465187de239183fb99e2396f5449e5d1d43910 100644 (file)
@@ -12,4 +12,5 @@ package org.opendaylight.openflowplugin.api.openflow.device.exception;
  * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 25.2.2015.
  */
 public class RequestQuotaExceededException extends Exception {
+    private static final long serialVersionUID = 1L;
 }
index 9d521e9fab7a937577317fbc9f03419e69d09c02..8699e27160013550afbf06a68dcb7774220c05f3 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.openflowplugin.api.openflow.device.listener;
 
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.MultiMsgCollector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener;
 
 /**
index 60bb67e1fddefe7ce7d4d3752dc5962584f6227a..94ce2b29090bd51db2fc9421e2c0a5d60d8cffff 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.openflowplugin.api.openflow.rpc;
 
-import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
 import org.opendaylight.yangtools.yang.binding.RpcService;
index 62a51acad39dc6f2efa6e4e3b0987a182d8b2605..e45c0771c58ca913fc986d0b741d27c41917c1cc 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.api.openflow.statistics;
 
 import com.google.common.util.concurrent.ListenableFuture;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.MultiMsgCollector;
 
 /**
  * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 27.2.2015.
index 7b59eb0d79294c53d49ce22e6c6f285e896ebaf0..8c529f1c9ed0dbd3f619a3befc2d143b7b07eb4a 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.openflowplugin.api.openflow.statistics;
 
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceContextClosedHandler;
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializator;
 
index 1c8f30af76853b7bc59c6bce177f0bdf27ce4e69..0195380626605b01e045f6f08cc46ad43e8121e0 100644 (file)
@@ -70,7 +70,7 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
     private DataBroker dataBroker;
     private OfpRole role;
     private Collection<SwitchConnectionProvider> switchConnectionProviders;
-    private Long rpcRequestsQuota;
+    private final Long rpcRequestsQuota;
 
     public OpenFlowPluginProviderImpl(final Long rpcRequestsQuota) {
         this.rpcRequestsQuota = rpcRequestsQuota;
@@ -151,11 +151,11 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
 
         TranslatorLibraryUtil.setBasicTranslatorLibrary(deviceManager);
         deviceManager.initialize();
-        
+
         startSwitchConnections();
     }
 
-    private void registerMXBean(final MessageIntelligenceAgency messageIntelligenceAgency) {
+    private static void registerMXBean(final MessageIntelligenceAgency messageIntelligenceAgency) {
         MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
         try {
             String pathToMxBean = String.format("%s:type=%s",
index ea2e556bc0bb60fe60fb199b28d6912d4599b94d..d49bfe6b2d71dd0709c3e15cb49a8a25e4db1536 100644 (file)
@@ -12,7 +12,6 @@ import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.TimeUnit;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionReadyListener;
-import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueueHandler;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionManager;
 import org.opendaylight.openflowplugin.api.openflow.connection.HandshakeContext;
@@ -83,7 +82,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
      * @return
      */
     private static ThreadPoolLoggingExecutor createHandshakePool(
-            final String connectionIdentifier, int handshakeThreadLimit) {
+            final String connectionIdentifier, final int handshakeThreadLimit) {
         return new ThreadPoolLoggingExecutor(handshakeThreadLimit,
                 handshakeThreadLimit, 0L, TimeUnit.MILLISECONDS,
                 new ArrayBlockingQueue<Runnable>(HELLO_LIMIT), "OFHandshake-" + connectionIdentifier);
@@ -95,7 +94,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
      * @return
      */
     private HandshakeManager createHandshakeManager(final ConnectionAdapter connectionAdapter,
-            HandshakeListener handshakeListener) {
+            final HandshakeListener handshakeListener) {
         HandshakeManagerImpl handshakeManager = new HandshakeManagerImpl(connectionAdapter,
                 ConnectionConductor.versionOrder.get(0),
                 ConnectionConductor.versionOrder);
@@ -116,23 +115,23 @@ public class ConnectionManagerImpl implements ConnectionManager {
     /**
      * @param bitmapNegotiationEnabled the bitmapNegotiationEnabled to set
      */
-    public void setBitmapNegotiationEnabled(boolean bitmapNegotiationEnabled) {
+    public void setBitmapNegotiationEnabled(final boolean bitmapNegotiationEnabled) {
         this.bitmapNegotiationEnabled = bitmapNegotiationEnabled;
     }
 
     @Override
-    public boolean accept(InetAddress switchAddress) {
+    public boolean accept(final InetAddress switchAddress) {
         // TODO add connection accept logic based on address
         return true;
     }
 
     @Override
-    public void setDeviceConnectedHandler(DeviceConnectedHandler deviceConnectedHandler) {
+    public void setDeviceConnectedHandler(final DeviceConnectedHandler deviceConnectedHandler) {
         this.deviceConnectedHandler = deviceConnectedHandler;
     }
 
     @Override
-    public void setMessageHandler(MessageHandler arg0) {
+    public void setMessageHandler(final MessageHandler arg0) {
         // TODO Auto-generated method stub
 
     }
index bf68d7107c53f6675ccd996f091f1ba02f1c5c99..ee586fdbc2b35116e77720703e825c023b368b4f 100644 (file)
@@ -33,7 +33,7 @@ public class ThrottledNotificationsOffererImpl<T extends Notification> implement
     private final Map<Queue<T>, SettableFuture<Void>> throttledQueues = new ConcurrentHashMap<>();
     private final ThreadPoolLoggingExecutor throttleWorkerPool;
     private final NotificationPublishService notificationPublishService;
-    private final MessageSpy<Class> messageIntelligenceAgency;
+    private final MessageSpy<Class<?>> messageIntelligenceAgency;
     private boolean finishing = false;
     private CountDownLatch sleeperLatch = new CountDownLatch(0);
 
@@ -41,7 +41,7 @@ public class ThrottledNotificationsOffererImpl<T extends Notification> implement
      * @param notificationPublishService
      * @param messageIntelligenceAgency
      */
-    public ThrottledNotificationsOffererImpl(NotificationPublishService notificationPublishService, MessageSpy<Class> messageIntelligenceAgency) {
+    public ThrottledNotificationsOffererImpl(final NotificationPublishService notificationPublishService, final MessageSpy<Class<?>> messageIntelligenceAgency) {
         this.notificationPublishService = notificationPublishService;
         this.messageIntelligenceAgency = messageIntelligenceAgency;
         throttleWorkerPool = new ThreadPoolLoggingExecutor(
@@ -51,7 +51,7 @@ public class ThrottledNotificationsOffererImpl<T extends Notification> implement
     }
 
     @Override
-    public ListenableFuture<Void> applyThrottlingOnConnection(Queue<T> notificationsQueue) {
+    public ListenableFuture<Void> applyThrottlingOnConnection(final Queue<T> notificationsQueue) {
         SettableFuture<Void> throttleWatching = SettableFuture.create();
         throttledQueues.put(notificationsQueue, throttleWatching);
         synchronized (throttledQueues) {
@@ -106,7 +106,7 @@ public class ThrottledNotificationsOffererImpl<T extends Notification> implement
     }
 
     @Override
-    public boolean isThrottlingEffective(Queue<T> notificationsQueue) {
+    public boolean isThrottlingEffective(final Queue<T> notificationsQueue) {
         return throttledQueues.containsKey(notificationsQueue);
     }
 
index 319306a9c19c4c9d6b8c805864f09fac53035d28..fb4b7dc12a997b5d9ae226b94e2d607ee9851e2d 100644 (file)
@@ -38,7 +38,6 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
-import org.opendaylight.openflowplugin.api.openflow.connection.OutboundQueueProvider;
 import org.opendaylight.openflowplugin.api.openflow.connection.ThrottledNotificationsOfferer;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
@@ -114,12 +113,12 @@ public class DeviceContextImpl implements DeviceContext {
     private final DeviceMeterRegistry deviceMeterRegistry;
     private Timeout barrierTaskTimeout;
     private NotificationService notificationService;
-    private final MessageSpy<Class> messageSpy;
+    private final MessageSpy<Class<?>> messageSpy;
     private DeviceDisconnectedHandler deviceDisconnectedHandler;
     private final Collection<DeviceContextClosedHandler> closeHandlers = new HashSet<>();
     private NotificationPublishService notificationPublishService;
     private final ThrottledNotificationsOfferer throttledConnectionsHolder;
-    private BlockingQueue<PacketReceived> bumperQueue;
+    private final BlockingQueue<PacketReceived> bumperQueue;
     private final OutboundQueue outboundQueueProvider;
 
     @Override
@@ -180,7 +179,7 @@ public class DeviceContextImpl implements DeviceContext {
         auxiliaryConnectionContexts.put(connectionDistinguisher, connectionContext);
     }
 
-    private SwitchConnectionDistinguisher createConnectionDistinguisher(final ConnectionContext connectionContext) {
+    private static SwitchConnectionDistinguisher createConnectionDistinguisher(final ConnectionContext connectionContext) {
         return new SwitchConnectionCookieOFImpl(connectionContext.getFeatures().getAuxiliaryId());
     }
 
index 37c841230805c22742a5690bfb262adec1804786..0560e945d5034c25fe9ad27e5103ae9e9b316f20 100644 (file)
@@ -242,7 +242,7 @@ public class DeviceManagerImpl implements DeviceManager, AutoCloseable {
         });
     }
 
-    private void chainTableTrunkWriteOF10(final DeviceContext deviceContext, final ListenableFuture<List<RpcResult<List<MultipartReply>>>> deviceFeaturesFuture) {
+    private static void chainTableTrunkWriteOF10(final DeviceContext deviceContext, final ListenableFuture<List<RpcResult<List<MultipartReply>>>> deviceFeaturesFuture) {
         Futures.addCallback(deviceFeaturesFuture, new FutureCallback<List<RpcResult<List<MultipartReply>>>>() {
             @Override
             public void onSuccess(final List<RpcResult<List<MultipartReply>>> results) {
@@ -264,7 +264,6 @@ public class DeviceManagerImpl implements DeviceManager, AutoCloseable {
         });
     }
 
-
     private ListenableFuture<RpcResult<List<MultipartReply>>> processReplyDesc(final DeviceContext deviceContext,
                                                                                final DeviceState deviceState) {
 
index 4570bf56a15d9538af14fa1da4a4d57567f6ac62..34326d87a1ccf2eb332894eedb3cd791d02f011d 100644 (file)
@@ -119,7 +119,7 @@ class TransactionChainManager implements TransactionChainListener {
         }
     }
 
-    void submitScheduledTransaction(Timeout timeout) {
+    void submitScheduledTransaction(final Timeout timeout) {
         if (timeout.isCancelled()) {
             // zombie timer executed
             return;
@@ -157,17 +157,17 @@ class TransactionChainManager implements TransactionChainListener {
         }
     }
 
-    private void hookTimeExpenseCounter(CheckedFuture<Void, TransactionCommitFailedException> submitResult, final String name) {
+    private static void hookTimeExpenseCounter(final CheckedFuture<Void, TransactionCommitFailedException> submitResult, final String name) {
         final long submitFiredTime = System.currentTimeMillis();
         LOG.debug("submit of {} fired", name);
         Futures.addCallback(submitResult, new FutureCallback<Void>() {
             @Override
-            public void onSuccess(Void result) {
+            public void onSuccess(final Void result) {
                 LOG.debug("submit of {} finished in {} ms", name, System.currentTimeMillis() - submitFiredTime);
             }
 
             @Override
-            public void onFailure(Throwable t) {
+            public void onFailure(final Throwable t) {
                 LOG.warn("transaction submit failed: {}", t.getMessage());
             }
         });
index 421f8793c8ead411a0690a1b6e44c042dd315c84..b0d2b122f9fcc2d01bdf5be655af6a5c6645cadf 100644 (file)
@@ -54,7 +54,7 @@ public class MultiMsgCollectorImpl implements MultiMsgCollector {
         cache = initCacheBuilder(timeout).build();
     }
 
-    private RemovalListener<Long, MultiCollectorObject> getRemovalListener() {
+    private static RemovalListener<Long, MultiCollectorObject> getRemovalListener() {
         return new RemovalListener<Long, MultiCollectorObject>() {
             @Override
             public void onRemoval(final RemovalNotification<Long, MultiCollectorObject> notification) {
@@ -67,7 +67,7 @@ public class MultiMsgCollectorImpl implements MultiMsgCollector {
         };
     }
 
-    private CacheBuilder<Long, MultiCollectorObject> initCacheBuilder(final int timeout) {
+    private static CacheBuilder<Long, MultiCollectorObject> initCacheBuilder(final int timeout) {
         return CacheBuilder.newBuilder()
                 .expireAfterAccess(timeout, TimeUnit.SECONDS)
                 .removalListener(getRemovalListener())
@@ -109,7 +109,7 @@ public class MultiMsgCollectorImpl implements MultiMsgCollector {
     }
 
     @Override
-    public void setDeviceReplyProcessor(DeviceReplyProcessor deviceReplyProcessor) {
+    public void setDeviceReplyProcessor(final DeviceReplyProcessor deviceReplyProcessor) {
         this.deviceReplyProcessor = deviceReplyProcessor;
     }
 
@@ -127,7 +127,7 @@ public class MultiMsgCollectorImpl implements MultiMsgCollector {
             replyCollection.add(reply);
         }
 
-        void publishCollection(long xid) {
+        void publishCollection(final long xid) {
             deviceReplyProcessor.processReply(new Xid(xid), replyCollection);
         }
 
index 2d3f49b25e173c7373ee8eb75c3749e8452bd121..001ccaaad73a267157cf663a7afec012deceeb43 100644 (file)
@@ -18,8 +18,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group
  */
 public class DeviceGroupRegistryImpl implements DeviceGroupRegistry {
 
-    private final List<GroupId> groupIdList = new ArrayList();
-    private final List<GroupId> marks = new ArrayList();
+    private final List<GroupId> groupIdList = new ArrayList<>();
+    private final List<GroupId> marks = new ArrayList<>();
 
     @Override
     public void store(final GroupId groupId) {
index 628179b29e0342ae114c2f6e7ca8f9f9d1a3670c..4d15fe3b86b3fcc3327c7f44413c47516e90dfaf 100644 (file)
@@ -18,8 +18,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter
  */
 public class DeviceMeterRegistryImpl implements DeviceMeterRegistry {
 
-    private final List<MeterId> meterIds = new ArrayList();
-    private final List<MeterId> marks = new ArrayList();
+    private final List<MeterId> meterIds = new ArrayList<>();
+    private final List<MeterId> marks = new ArrayList<>();
 
     @Override
     public void store(final MeterId meterId) {
index 327f559560c5d36ab76135ddd5f89bfa3ba255f4..9bf4757cedc6348502458905c1913fbab5a385ca 100644 (file)
@@ -112,7 +112,7 @@ public class SinglePurposeMultipartReplyTranslator {
     private static MeterStatsResponseConvertor meterStatsConvertor = new MeterStatsResponseConvertor();
 
 
-    public List<DataObject> translate(DeviceContext deviceContext, OfHeader msg) {
+    public List<DataObject> translate(final DeviceContext deviceContext, final OfHeader msg) {
 
         List<DataObject> listDataObject = new CopyOnWriteArrayList<DataObject>();
 
@@ -121,7 +121,7 @@ public class SinglePurposeMultipartReplyTranslator {
         final FeaturesReply features = deviceContext.getPrimaryConnectionContext().getFeatures();
         if (msg instanceof MultipartReplyMessage) {
             MultipartReplyMessage mpReply = (MultipartReplyMessage) msg;
-            NodeId node = this.nodeIdFromDatapathId(features.getDatapathId());
+            NodeId node = SinglePurposeMultipartReplyTranslator.nodeIdFromDatapathId(features.getDatapathId());
             switch (mpReply.getType()) {
                 case OFPMPFLOW: {
                     FlowsStatisticsUpdateBuilder message = new FlowsStatisticsUpdateBuilder();
@@ -182,10 +182,12 @@ public class SinglePurposeMultipartReplyTranslator {
                         statsBuilder.setPackets(packetsBuilder.build());
 
                         DurationBuilder durationBuilder = new DurationBuilder();
-                        if (portStats.getDurationSec() != null)
+                        if (portStats.getDurationSec() != null) {
                             durationBuilder.setSecond(new Counter32(portStats.getDurationSec()));
-                        if (portStats.getDurationNsec() != null)
+                        }
+                        if (portStats.getDurationNsec() != null) {
                             durationBuilder.setNanosecond(new Counter32(portStats.getDurationNsec()));
+                        }
                         statsBuilder.setDuration(durationBuilder.build());
                         statsBuilder.setCollisionCount(portStats.getCollisions());
                         statsBuilder.setKey(new NodeConnectorStatisticsAndPortNumberMapKey(statsBuilder.getNodeConnectorId()));
@@ -426,15 +428,14 @@ public class SinglePurposeMultipartReplyTranslator {
         return listDataObject;
     }
 
-    private NodeId nodeIdFromDatapathId(BigInteger datapathId) {
+    private static NodeId nodeIdFromDatapathId(final BigInteger datapathId) {
         String current = datapathId.toString();
         return new NodeId("openflow:" + current);
     }
 
-    private TransactionId generateTransactionId(Long xid) {
+    private static TransactionId generateTransactionId(final Long xid) {
         BigInteger bigIntXid = BigInteger.valueOf(xid);
         return new TransactionId(bigIntXid);
-
     }
 
     /*
@@ -446,7 +447,7 @@ public class SinglePurposeMultipartReplyTranslator {
      * @param actionsSupported
      * @return
      */
-    private List<Long> getGroupActionsSupportBitmap(List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType> actionsSupported) {
+    private static List<Long> getGroupActionsSupportBitmap(final List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType> actionsSupported) {
         List<Long> supportActionByGroups = new ArrayList<Long>();
         for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType supportedActions : actionsSupported) {
             long supportActionBitmap = 0;
index 79d9f70d44ee441801888f30dab97de7c431431d..7be9e11d1f1e955b925332720cc1ace3972c45c8 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
@@ -37,7 +36,7 @@ public class StatisticsContextImpl implements StatisticsContext {
 
     private static final Logger LOG = LoggerFactory.getLogger(StatisticsContextImpl.class);
     public static final String CONNECTION_CLOSED = "Connection closed.";
-    private final Collection<RequestContext> requestContexts = new HashSet<>();
+    private final Collection<RequestContext<?>> requestContexts = new HashSet<>();
     private final DeviceContext deviceContext;
 
 
@@ -52,7 +51,7 @@ public class StatisticsContextImpl implements StatisticsContext {
     @Override
     public ListenableFuture<Boolean> gatherDynamicData() {
 
-        final SettableFuture settableResultingFuture = SettableFuture.create();
+        final SettableFuture<Boolean> settableResultingFuture = SettableFuture.create();
         ListenableFuture<Boolean> resultingFuture = settableResultingFuture;
 
 
index f83e9f5753252ce772db7d86cdffc913fd1be822..db67901af30e446dd17d7c29f367ea49a216fbd6 100644 (file)
@@ -8,23 +8,21 @@
 
 package org.opendaylight.openflowplugin.impl.statistics;
 
-import java.util.concurrent.ExecutionException;
+import com.google.common.base.Function;
 import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
 import com.google.common.collect.Iterables;
-import java.util.Collections;
-import com.google.common.base.Function;
+import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.JdkFutureAdapters;
 import com.google.common.util.concurrent.ListenableFuture;
+import java.util.Collections;
 import java.util.List;
+import java.util.concurrent.ExecutionException;
 import javax.annotation.Nullable;
+import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
-import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowDescriptor;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowHash;
 import org.opendaylight.openflowplugin.impl.registry.flow.FlowHashFactory;
 import org.opendaylight.openflowplugin.impl.statistics.services.dedicated.StatisticsGatheringService;
@@ -35,6 +33,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.me
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
@@ -178,7 +177,7 @@ public final class StatisticsGatheringUtils {
             for (MeterConfigStats meterConfigStats : meterConfigStatsUpdated.getMeterConfigStats()) {
                 final MeterId meterId = meterConfigStats.getMeterId();
                 final InstanceIdentifier<Meter> meterInstanceIdentifier = fNodeIdent.child(Meter.class, new MeterKey(meterId));
-    
+
                 final MeterBuilder meterBuilder = new MeterBuilder(meterConfigStats);
                 meterBuilder.setKey(new MeterKey(meterId));
                 meterBuilder.addAugmentation(NodeMeterStatistics.class, new NodeMeterStatisticsBuilder().build());
@@ -198,7 +197,7 @@ public final class StatisticsGatheringUtils {
                 final FlowBuilder flowBuilder = new FlowBuilder(flowStat);
                 short tableId = flowStat.getTableId();
                 final Short version = deviceContext.getPrimaryConnectionContext().getFeatures().getVersion();
-                
+
                 final FlowHash flowHash = FlowHashFactory.create(flowBuilder.build(), version);
                 final FlowId flowId = deviceContext.getDeviceFlowRegistry().storeIfNecessary(flowHash, tableId);
 
@@ -262,7 +261,7 @@ public final class StatisticsGatheringUtils {
     private static void processFlowTableStatistics(final Iterable<FlowTableStatisticsUpdate> data, final DeviceContext deviceContext) {
         for(final FlowTableStatisticsUpdate flowTableStatisticsUpdate : data) {
             final InstanceIdentifier<FlowCapableNode> fNodeIdent = getFlowCapableNodeInstanceIdentifier(flowTableStatisticsUpdate.getId());
-    
+
             for (final FlowTableAndStatisticsMap tableStat : flowTableStatisticsUpdate.getFlowTableAndStatisticsMap()) {
                 final InstanceIdentifier<FlowTableStatistics> tStatIdent = fNodeIdent.child(Table.class, new TableKey(tableStat.getTableId().getValue()))
                         .augmentation(FlowTableStatisticsData.class).child(FlowTableStatistics.class);
@@ -319,16 +318,16 @@ public final class StatisticsGatheringUtils {
         for ( GroupDescStatsUpdated groupDescStatsUpdated : data) {
             NodeId nodeId = groupDescStatsUpdated.getId();
             final InstanceIdentifier<FlowCapableNode> fNodeIdent = getFlowCapableNodeInstanceIdentifier(nodeId);
-    
+
             for (GroupDescStats groupDescStats : groupDescStatsUpdated.getGroupDescStats()) {
                 final GroupId groupId = groupDescStats.getGroupId();
-    
+
                 final GroupBuilder groupBuilder = new GroupBuilder(groupDescStats);
                 groupBuilder.setKey(new GroupKey(groupId));
                 groupBuilder.addAugmentation(NodeGroupStatistics.class, new NodeGroupStatisticsBuilder().build());
-    
+
                 final InstanceIdentifier<Group> groupIdent = fNodeIdent.child(Group.class, new GroupKey(groupId));
-    
+
                 deviceContext.getDeviceGroupRegistry().store(groupId);
                 deviceContext.writeToTransaction(LogicalDatastoreType.OPERATIONAL, groupIdent, groupBuilder.build());
             }
@@ -349,11 +348,11 @@ public final class StatisticsGatheringUtils {
         deleteAllKnownGroups(deviceContext, fNodeIdent);
         for (GroupStatisticsUpdated groupStatistics : data) {
             for (final GroupStats groupStats : groupStatistics.getGroupStats()) {
-    
+
                 final InstanceIdentifier<Group> groupIdent = fNodeIdent.child(Group.class, new GroupKey(groupStats.getGroupId()));
                 final InstanceIdentifier<NodeGroupStatistics> nGroupStatIdent = groupIdent
                         .augmentation(NodeGroupStatistics.class);
-    
+
                 final InstanceIdentifier<GroupStatistics> gsIdent = nGroupStatIdent.child(GroupStatistics.class);
                 final GroupStatistics stats = new GroupStatisticsBuilder(groupStats).build();
                 deviceContext.writeToTransaction(LogicalDatastoreType.OPERATIONAL, gsIdent, stats);
index 439b7a7c83f30d1a95769bf2f9178628096d4194..ea0daf2f3c50d8d7a2517f479c11bbe39f47fb97 100644 (file)
@@ -34,7 +34,7 @@ public class StatisticsManagerImpl implements StatisticsManager {
 
     private HashedWheelTimer hashedWheelTimer;
 
-    private ConcurrentHashMap<DeviceContext, StatisticsContext> contexts = new ConcurrentHashMap();
+    private final ConcurrentHashMap<DeviceContext, StatisticsContext> contexts = new ConcurrentHashMap<>();
 
     private final TimeCounter timeCounter = new TimeCounter();
 
@@ -87,10 +87,10 @@ public class StatisticsManagerImpl implements StatisticsManager {
         try {
             timeCounter.markStart();
             for (final StatisticsContext statisticsContext : contexts.values()) {
-                ListenableFuture deviceStatisticsCollectionFuture = statisticsContext.gatherDynamicData();
-                Futures.addCallback(deviceStatisticsCollectionFuture, new FutureCallback() {
+                ListenableFuture<Boolean> deviceStatisticsCollectionFuture = statisticsContext.gatherDynamicData();
+                Futures.addCallback(deviceStatisticsCollectionFuture, new FutureCallback<Boolean>() {
                     @Override
-                    public void onSuccess(final Object o) {
+                    public void onSuccess(final Boolean o) {
                         timeCounter.addTimeMark();
                     }
 
index 858f554091cbcb911c8d11b72cfc1e85dd18ecf7..ffd422f66f9907cfbdab850735445f5f12c4fd2d 100644 (file)
@@ -24,7 +24,7 @@ import org.slf4j.LoggerFactory;
  * Class counts message of {@link org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy.STATISTIC_GROUP} type
  * and provides info as debug log.
  */
-public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency<Class>, MessageIntelligenceAgencyMXBean {
+public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency<Class<?>>, MessageIntelligenceAgencyMXBean {
 
     private static final Logger LOG = LoggerFactory.getLogger(MessageIntelligenceAgencyImpl.class);
 
@@ -48,10 +48,10 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency<
         }
     }
 
-    private final ConcurrentMap<STATISTIC_GROUP, ConcurrentMap<Class, MessageCounters>> inputStats = new ConcurrentHashMap<>();
+    private final ConcurrentMap<STATISTIC_GROUP, ConcurrentMap<Class<?>, MessageCounters>> inputStats = new ConcurrentHashMap<>();
 
     @Override
-    public void spyMessage(final Class message, final STATISTIC_GROUP statGroup) {
+    public void spyMessage(final Class<?> message, final STATISTIC_GROUP statGroup) {
         getCounters(message, statGroup).increment();
     }
 
@@ -60,13 +60,13 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency<
      * @param statGroup TODO
      * @return
      */
-    private MessageCounters getCounters(final Class message, final STATISTIC_GROUP statGroup) {
-        ConcurrentMap<Class, MessageCounters> groupData = getOrCreateGroupData(statGroup);
+    private MessageCounters getCounters(final Class<?> message, final STATISTIC_GROUP statGroup) {
+        ConcurrentMap<Class<?>, MessageCounters> groupData = getOrCreateGroupData(statGroup);
         MessageCounters counters = getOrCreateCountersPair(message, groupData);
         return counters;
     }
 
-    private static MessageCounters getOrCreateCountersPair(final Class msgType, final ConcurrentMap<Class, MessageCounters> groupData) {
+    private static MessageCounters getOrCreateCountersPair(final Class<?> msgType, final ConcurrentMap<Class<?>, MessageCounters> groupData) {
         final MessageCounters lookup = groupData.get(msgType);
         if (lookup != null) {
             return lookup;
@@ -78,14 +78,14 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency<
 
     }
 
-    private ConcurrentMap<Class, MessageCounters> getOrCreateGroupData(final STATISTIC_GROUP statGroup) {
-        final ConcurrentMap<Class, MessageCounters> lookup = inputStats.get(statGroup);
+    private ConcurrentMap<Class<?>, MessageCounters> getOrCreateGroupData(final STATISTIC_GROUP statGroup) {
+        final ConcurrentMap<Class<?>, MessageCounters> lookup = inputStats.get(statGroup);
         if (lookup != null) {
             return lookup;
         }
 
-        final ConcurrentMap<Class, MessageCounters> newmap = new ConcurrentHashMap<>();
-        final ConcurrentMap<Class, MessageCounters> check = inputStats.putIfAbsent(statGroup, newmap);
+        final ConcurrentMap<Class<?>, MessageCounters> newmap = new ConcurrentHashMap<>();
+        final ConcurrentMap<Class<?>, MessageCounters> check = inputStats.putIfAbsent(statGroup, newmap);
 
         return check == null ? newmap : check;
     }
@@ -105,9 +105,9 @@ public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency<
         List<String> dump = new ArrayList<>();
 
         for (STATISTIC_GROUP statGroup : STATISTIC_GROUP.values()) {
-            Map<Class, MessageCounters> groupData = inputStats.get(statGroup);
+            Map<Class<?>, MessageCounters> groupData = inputStats.get(statGroup);
             if (groupData != null) {
-                for (Entry<Class, MessageCounters> statEntry : groupData.entrySet()) {
+                for (Entry<Class<?>, MessageCounters> statEntry : groupData.entrySet()) {
                     long amountPerInterval = statEntry.getValue().accumulate();
                     long cumulativeAmount = statEntry.getValue().getCumulative();
                     dump.add(String.format("%s: MSG[%s] -> +%d | %d",
index de8e3a26ca3115bcefb9b845390a407fa39bb659..93cdb5497fed7b4dc5e29f4c242c02bdadfe6f73 100644 (file)
@@ -4,23 +4,18 @@ import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter32;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter64;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdate;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdateBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.get.aggregate.flow.statistics.from.flow.table._for.given.match.output.AggregatedFlowStatistics;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.get.aggregate.flow.statistics.from.flow.table._for.given.match.output.AggregatedFlowStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyAggregateCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.aggregate._case.MultipartReplyAggregate;
 
-import java.math.BigInteger;
-
 /**
  * Created by tkubas on 4/27/15.
  */
 public class AggregatedFlowStatisticsTranslator implements MessageTranslator<MultipartReply, AggregatedFlowStatistics> {
     @Override
-    public AggregatedFlowStatistics translate(MultipartReply input, DeviceContext deviceContext, Object connectionDistinguisher) {
+    public AggregatedFlowStatistics translate(final MultipartReply input, final DeviceContext deviceContext, final Object connectionDistinguisher) {
         AggregatedFlowStatisticsBuilder aggregatedFlowStatisticsBuilder = new AggregatedFlowStatisticsBuilder();
 
         MultipartReplyAggregateCase caseBody = (MultipartReplyAggregateCase)input.getMultipartReplyBody();
index c91d526de802fd6e28943370174681b7b0d47512..6e5bceecafe2d7af5a8eab010e03d53fa22bb4cd 100644 (file)
@@ -33,7 +33,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.pa
  */
 public class PacketReceivedTranslator implements MessageTranslator<PacketInMessage, PacketReceived> {
     @Override
-    public PacketReceived translate(PacketInMessage input, DeviceContext deviceContext, Object connectionDistinguisher) {
+    public PacketReceived translate(final PacketInMessage input, final DeviceContext deviceContext, final Object connectionDistinguisher) {
 
         PacketReceivedBuilder packetReceivedBuilder = new PacketReceivedBuilder();
         BigInteger datapathId = deviceContext.getPrimaryConnectionContext().getFeatures().getDatapathId();
@@ -73,7 +73,7 @@ public class PacketReceivedTranslator implements MessageTranslator<PacketInMessa
         return packetReceivedBuilder.build();
     }
 
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match getPacketInMatch(PacketInMessage input, BigInteger datapathId) {
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match getPacketInMatch(final PacketInMessage input, final BigInteger datapathId) {
         Match match = MatchConvertorImpl.fromOFMatchToSALMatch(input.getMatch(),
                 datapathId,
                 OpenflowVersion.get(input.getVersion().shortValue())).build();
@@ -88,7 +88,7 @@ public class PacketReceivedTranslator implements MessageTranslator<PacketInMessa
         return matchBuilder.build();
     }
 
-    private Long getPortNumberFromMatch(List<MatchEntry> entries) {
+    private static Long getPortNumberFromMatch(final List<MatchEntry> entries) {
         Long port = null;
         for (MatchEntry entry : entries) {
             if (InPortCase.class.equals(entry.getMatchEntryValue().getImplementedInterface())) {
index 4769149fdb00d8c6efbc08165861d785adfe1ed8..1ed582472f226acafe668a11d2395faa042288d3 100644 (file)
@@ -21,7 +21,7 @@ public class TranslatorKeyFactory {
         this.version = version;
     }
 
-    public TranslatorKey createTranslatorKey(Class messageClass) {
+    public TranslatorKey createTranslatorKey(final Class<?> messageClass) {
         return new TranslatorKey(version, messageClass.getName().toString());
     }
 }
index 4b0e367939d7101cc8efd719b323b22bdc3845fa..3cd4f4fb0d4cede560bd51f13ddd2da32ede4a12 100644 (file)
@@ -11,7 +11,6 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
-
 import java.math.BigInteger;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
@@ -108,7 +107,7 @@ public class RpcManagerImplTest {
     /**
      * @return
      */
-    private AddFlowInput prepareTestingAddFlow() {
+    private static AddFlowInput prepareTestingAddFlow() {
         final AddFlowInputBuilder builder = new AddFlowInputBuilder();
         builder.setFlowName("dummy flow");
         builder.setHardTimeout(10000);
index 65bea069a4a69570fba2d09f1800235afda2edb1..141740688ceb4b663e4f86948fa227d6f9ad02db 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowplugin.impl.common;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
-
 import java.math.BigInteger;
 import java.util.Arrays;
 import java.util.List;
@@ -194,7 +193,7 @@ public class NodeConnectorTranslatorUtilTest {
         return phyport;
     }
 
-    private PortStateV10 getPortStateV10() {
+    private static PortStateV10 getPortStateV10() {
         final PortStateV10 portState = new PortStateV10(Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE);
         return portState;
     }
@@ -214,7 +213,7 @@ public class NodeConnectorTranslatorUtilTest {
                 pfV10Bls[7], pfV10Bls[8], pfV10Bls[9], pfV10Bls[10], pfV10Bls[11]);
     }
 
-    private MacAddress getMacAddress() {
+    private static MacAddress getMacAddress() {
         return new MacAddress(MAC_ADDRESS);
     }
 
@@ -226,19 +225,19 @@ public class NodeConnectorTranslatorUtilTest {
         return new PortConfig(portCfgBools[0], portCfgBools[1], portCfgBools[2], portCfgBools[3]);
     }
 
-    private void assertEqualsStateV10(final PortStateV10 psV10, final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState state) {
+    private static void assertEqualsStateV10(final PortStateV10 psV10, final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState state) {
         assertEquals(psV10.isBlocked(), state.isBlocked());
         assertEquals(psV10.isLinkDown(), state.isLinkDown());
         assertEquals(psV10.isLive(), state.isLive());
     }
 
-    private void assertEqualsState(final PortState ps, final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState state) {
+    private static void assertEqualsState(final PortState ps, final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortState state) {
         assertEquals(ps.isBlocked(), state.isBlocked());
         assertEquals(ps.isLinkDown(), state.isLinkDown());
         assertEquals(ps.isLive(), state.isLive());
     }
 
-    private void assertEqualsPortFeaturesV10(final PortFeaturesV10 apfV10, final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures npf) {
+    private static void assertEqualsPortFeaturesV10(final PortFeaturesV10 apfV10, final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures npf) {
         assertEquals(apfV10.is_100mbFd(), npf.isHundredMbFd());
         assertEquals(apfV10.is_100mbHd(), npf.isHundredMbHd());
 
@@ -256,7 +255,7 @@ public class NodeConnectorTranslatorUtilTest {
         assertEquals(apfV10.isPauseAsym(), npf.isPauseAsym());
     }
 
-    private void assertEqualsPortFeatures(final PortFeatures apf, final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures npf) {
+    private static void assertEqualsPortFeatures(final PortFeatures apf, final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures npf) {
         assertEquals(apf.is_100gbFd(), npf.isHundredGbFd());
         assertEquals(apf.is_100mbFd(), npf.isHundredMbFd());
         assertEquals(apf.is_100mbHd(), npf.isHundredMbHd());
index 5e402dfc03cdb1f2c9a2b00c5f79f35be1e4c84d..ec9ddae4e6ada4371a4dc2dae083eec3524f9ec3 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.impl.registry.flow;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
-
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -56,7 +55,7 @@ public class FlowHashFactoryTest {
 
     @Before
     public void setup() {
-        List<FlowAndStatisticsMapList> flowAndStatisticsMapListList = new ArrayList();
+        List<FlowAndStatisticsMapList> flowAndStatisticsMapListList = new ArrayList<>();
         for (int i = 1; i < 4; i++) {
             FlowAndStatisticsMapListBuilder flowAndStatisticsMapListBuilder = new FlowAndStatisticsMapListBuilder();
             flowAndStatisticsMapListBuilder.setPriority(i);
@@ -90,7 +89,7 @@ public class FlowHashFactoryTest {
     public void testEquals() throws Exception {
         FlowsStatisticsUpdate flowStats = FLOWS_STATISTICS_UPDATE_BUILDER.build();
 
-        HashSet<FlowHash> flowHashs = new HashSet();
+        HashSet<FlowHash> flowHashs = new HashSet<>();
         for (FlowAndStatisticsMapList item : flowStats.getFlowAndStatisticsMapList()) {
             flowHashs.add(FlowHashFactory.create(item, OFConstants.OFP_VERSION_1_3));
             flowHashs.add(FlowHashFactory.create(item, OFConstants.OFP_VERSION_1_3));