Fix odlparent 3 Checkstyle issues 93/66493/1
authorTom Pantelis <tompantelis@gmail.com>
Fri, 15 Dec 2017 03:22:27 +0000 (22:22 -0500)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 15 Dec 2017 03:23:13 +0000 (22:23 -0500)
Change-Id: I9ed666294ecdfa04290dc56dcf3610c85b117e92
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
30 files changed:
.gitignore
applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowReader.java
applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterSequential.java
applications/lldp-speaker/src/main/java/org/opendaylight/openflowplugin/applications/lldpspeaker/LLDPSpeaker.java
applications/lldp-speaker/src/main/java/org/opendaylight/openflowplugin/applications/lldpspeaker/LLDPUtil.java
applications/lldp-speaker/src/test/java/org/opendaylight/openflowplugin/applications/lldpspeaker/TestUtils.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProvider.java
applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/tools/NotificationProviderConfig.java
applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderTest.java
applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/helper/TestChangeEventBuildHelper.java
applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/impl/helper/TestSupplierVerifyHelper.java
applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/util/ShellUtil.java
applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/TopologyManagerUtil.java
applications/topology-manager/src/test/java/org/opendaylight/openflowplugin/applications/topology/manager/TestUtils.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/HandshakeManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.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/test/java/org/opendaylight/openflowplugin/impl/common/MultipartRequestInputFactoryTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/karaf/ClearStatsCommandProviderTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/registry/flow/DeviceFlowRegistryImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsManagerImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/AbstractCompatibleStatServiceTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/translator/PacketReceivedTranslatorTest.java

index af1fb3cfea12caf0dcbb9d6bdbd8445405cc21a9..af2cea949ae20c3206397a2c5a09fb844973d23c 100644 (file)
@@ -30,3 +30,4 @@ maven-metadata-local.xml
 nbactions.xml
 nb-configuration.xml
 .fbExcludeFilterFile
+.factorypath
index de5f8952a4274e27dab4fa4186a662a202b458fd..9968f4e0b1bb44583d4d002b1a0ef9b1b08ecafd 100644 (file)
@@ -63,14 +63,14 @@ public final class FlowReader implements Runnable, FlowCounterMBean {
 
     @Override
     public void run() {
-        readFlowsX(dpnCount, flowsPerDpn, verbose);
+        readFlowsX();
     }
 
-    private void readFlowsX(Integer dpnCount, Integer flowsPerDPN, boolean verbose) {
+    private void readFlowsX() {
         readOpStatus.set(FlowCounter.OperationStatus.IN_PROGRESS.status());
         for (int i = 1; i <= dpnCount; i++) {
             String dpId = BulkOMaticUtils.DEVICE_TYPE_PREFIX + i;
-            for (int j = 0; j < flowsPerDPN; j++) {
+            for (int j = 0; j < flowsPerDpn; j++) {
                 short tableRollover = (short) (endTableId - startTableId + 1);
                 short tableId = (short) (j % tableRollover + startTableId);
 
index bc10525785de7b53e3674ec525bc7d98a06d2bb2..7e8fe0009fab658b03f81e8f2ae3379d13100036 100644 (file)
@@ -39,24 +39,24 @@ public class FlowWriterSequential implements FlowCounterMBean {
         LOG.info("Using Sequential implementation of Flow Writer.");
     }
 
-    public void addFlows(Integer dpnCount, Integer flowsPerDPN, int batchSize, int sleepMillis, short startTableId,
+    public void addFlows(Integer count, Integer flowsPerDPN, int batchSize, int sleepMillis, short startTableId,
             short endTableId, boolean isCreateParents) {
         LOG.info("Using Sequential implementation of Flow Writer.");
-        this.dpnCount = dpnCount;
-        countDpnWriteCompletion.set(dpnCount);
+        this.dpnCount = count;
+        countDpnWriteCompletion.set(count);
         startTime = System.nanoTime();
-        for (int i = 1; i <= dpnCount; i++) {
+        for (int i = 1; i <= count; i++) {
             FlowHandlerTask task = new FlowHandlerTask(Integer.toString(i), flowsPerDPN, true, batchSize, sleepMillis,
                     startTableId, endTableId, isCreateParents);
             flowPusher.execute(task);
         }
     }
 
-    public void deleteFlows(Integer dpnCount, Integer flowsPerDPN, int batchSize, short startTableId,
+    public void deleteFlows(Integer count, Integer flowsPerDPN, int batchSize, short startTableId,
             short endTableId) {
         LOG.info("Using Sequential implementation of Flow Writer.");
-        countDpnWriteCompletion.set(dpnCount);
-        for (int i = 1; i <= dpnCount; i++) {
+        countDpnWriteCompletion.set(count);
+        for (int i = 1; i <= count; i++) {
             FlowHandlerTask task = new FlowHandlerTask(Integer.toString(i), flowsPerDPN, false, batchSize, 0,
                     startTableId, endTableId, false);
             flowPusher.execute(task);
index 14d82dd220e1c25a7791fdba8fa16d0176137eef..e0684923749c5f41db173fba71adb261629a12fb 100644 (file)
@@ -110,9 +110,6 @@ public class LLDPSpeaker implements AutoCloseable, NodeConnectorEventsObserver,
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void nodeConnectorAdded(final InstanceIdentifier<NodeConnector> nodeConnectorInstanceId,
                                    final FlowCapableNodeConnector flowConnector) {
@@ -154,9 +151,6 @@ public class LLDPSpeaker implements AutoCloseable, NodeConnectorEventsObserver,
         packetProcessingService.transmitPacket(packet);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void nodeConnectorRemoved(final InstanceIdentifier<NodeConnector> nodeConnectorInstanceId) {
         nodeConnectorMap.remove(nodeConnectorInstanceId);
index 8373d97338d580333294c341a8922eaa1282327a..0966303200bb058382bce2533b608fb2941be270 100644 (file)
@@ -33,6 +33,9 @@ public final class LLDPUtil {
     private static final Logger LOG = LoggerFactory.getLogger(LLDPUtil.class);
     private static final String OF_URI_PREFIX = "openflow:";
 
+    private LLDPUtil() {
+    }
+
     static byte[] buildLldpFrame(final NodeId nodeId, final NodeConnectorId nodeConnectorId, final MacAddress src,
                                  final Long outPortNo, final MacAddress destinationAddress) {
         // Create discovery pkt
index e6ab666b65a0405e66194ed651f3d943068cf00c..a36bdb5010f56ce047266361fed2d1203b09e440 100644 (file)
@@ -25,7 +25,10 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 /**
  * Helper methods that are used by multiple tests.
  */
-public class TestUtils {
+public final class TestUtils {
+    private TestUtils() {
+    }
+
     static InstanceIdentifier<NodeConnector> createNodeConnectorId(String nodeKey, String nodeConnectorKey) {
         return InstanceIdentifier.builder(Nodes.class)
                 .child(Node.class, new NodeKey(new NodeId(nodeKey)))
index 496d6741eeeff8286d3ce8f5ca403570dbb01c2b..6432c98f06e60d5a3e13f70fb5acee5420b9444a 100644 (file)
@@ -113,25 +113,26 @@ public class NotificationProvider implements AutoCloseable {
     /**
      * Method to initialize NotificationProviderConfig.
      */
-    private NotificationProviderConfig initializeNotificationProviderConfig(boolean flowSupp, boolean meterSupp,
-                                                                            boolean groupSupp,
-                                                                            boolean connectorStatSupp,
-                                                                            boolean flowStatSupp,
-                                                                            boolean flowTableStatSupp,
-                                                                            boolean meterStatSupp,
-                                                                            boolean groupStatSupp,
-                                                                            boolean queueStatSupp) {
+    private NotificationProviderConfig initializeNotificationProviderConfig(boolean hasFlowSupp,
+                                                                            boolean hasMeterSupp,
+                                                                            boolean hasGroupSupp,
+                                                                            boolean hasConnectorStatSupp,
+                                                                            boolean hasFlowStatSupp,
+                                                                            boolean hasFlowTableStatSupp,
+                                                                            boolean hasMeterStatSupp,
+                                                                            boolean hasGroupStatSupp,
+                                                                            boolean hasQueueStatSupp) {
         NotificationProviderConfig.NotificationProviderConfigBuilder notif
                 = new NotificationProviderConfig.NotificationProviderConfigBuilder();
-        notif.setFlowSupport(flowSupp);
-        notif.setMeterSupport(meterSupp);
-        notif.setGroupSupport(groupSupp);
-        notif.setNodeConnectorStatSupport(connectorStatSupp);
-        notif.setFlowStatSupport(flowStatSupp);
-        notif.setFlowTableStatSupport(flowTableStatSupp);
-        notif.setMeterStatSupport(meterStatSupp);
-        notif.setGroupStatSupport(groupStatSupp);
-        notif.setQueueStatSupport(queueStatSupp);
+        notif.setFlowSupport(hasFlowSupp);
+        notif.setMeterSupport(hasMeterSupp);
+        notif.setGroupSupport(hasGroupSupp);
+        notif.setNodeConnectorStatSupport(hasConnectorStatSupp);
+        notif.setFlowStatSupport(hasFlowStatSupp);
+        notif.setFlowTableStatSupport(hasFlowTableStatSupp);
+        notif.setMeterStatSupport(hasMeterStatSupp);
+        notif.setGroupStatSupport(hasGroupStatSupp);
+        notif.setQueueStatSupport(hasQueueStatSupp);
         return notif.build();
     }
 
index ef926439969ec6ec3c72bfc2e9d81c3c72996a63..f5c34558a5e3ec501ea4c3c9bc8718b4efd9cd60 100644 (file)
@@ -11,7 +11,7 @@ package org.opendaylight.openflowplugin.applications.notification.supplier.tools
 /**
  * Class is designed as ConfigSubsystem settings holder.
  */
-public class NotificationProviderConfig {
+public final class NotificationProviderConfig {
 
     private final boolean flowSupport;
     private final boolean meterSupport;
index bb2b976858f9ba3fb921be045c6c228b83443fa6..8d39252a35fc2032c8e84db37cc58da524d50655 100644 (file)
@@ -22,7 +22,6 @@ import org.opendaylight.openflowplugin.applications.notification.supplier.tools.
 public class NotificationProviderTest {
 
     private NotificationProviderService notificationProviderService;
-    private NotificationProviderConfig config;
     private DataBroker dataBroker;
 
     @Before
@@ -32,26 +31,22 @@ public class NotificationProviderTest {
     }
 
     @Test
-    public void testCreateAllSuppliers() {
+    public void testCreateAllSuppliers() throws Exception {
         final NotificationProviderConfig config = createAllConfigSupplier();
-        final NotificationProvider provider = new NotificationProvider(notificationProviderService, dataBroker,
-                                                                       config.isFlowSupport(), config.isMeterSupport(),
-                                                                       config.isGroupSupport(),
-                                                                       config.isNodeConnectorStatSupport(),
-                                                                       config.isFlowStatSupport(),
-                                                                       config.isFlowTableStatSupport(),
-                                                                       config.isMeterStatSupport(),
-                                                                       config.isGroupStatSupport(),
-                                                                       config.isQueueStatSupport());
-        provider.start();
-        final List<NotificationSupplierDefinition<?>> listSuppliers = provider.getSupplierList();
-        int nrOfSuppliers = 0;
-        for (final NotificationSupplierDefinition<?> supplier : listSuppliers) {
-            if (supplier != null) {
-                nrOfSuppliers++;
+        try (NotificationProvider provider = new NotificationProvider(notificationProviderService, dataBroker,
+                config.isFlowSupport(), config.isMeterSupport(), config.isGroupSupport(),
+                config.isNodeConnectorStatSupport(), config.isFlowStatSupport(), config.isFlowTableStatSupport(),
+                config.isMeterStatSupport(), config.isGroupStatSupport(), config.isQueueStatSupport())) {
+            provider.start();
+            final List<NotificationSupplierDefinition<?>> listSuppliers = provider.getSupplierList();
+            int nrOfSuppliers = 0;
+            for (final NotificationSupplierDefinition<?> supplier : listSuppliers) {
+                if (supplier != null) {
+                    nrOfSuppliers++;
+                }
             }
+            assertEquals(11, nrOfSuppliers);
         }
-        assertEquals(11, nrOfSuppliers);
     }
 
     @Test
index 7200d6cb682bb94f05fbe4e5e13c5a19083f3cff..19976b34e18c439e6dcae8307af5b367689e25d6 100644 (file)
@@ -11,7 +11,7 @@ package org.opendaylight.openflowplugin.applications.notification.supplier.impl.
 import java.util.Collection;
 import java.util.Collections;
 
-public class TestChangeEventBuildHelper {
+public final class TestChangeEventBuildHelper {
 
     private TestChangeEventBuildHelper() {
         throw new UnsupportedOperationException("Test utility class");
index 0e801b4336dc55d4e9b58f41c8a50385bcd4a164..adba9bf4fc92984c3b8baa8da04fe44be4564a3d 100644 (file)
@@ -14,7 +14,7 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
 
-public class TestSupplierVerifyHelper {
+public final class TestSupplierVerifyHelper {
 
     private TestSupplierVerifyHelper() {
         throw new UnsupportedOperationException("Test utility class");
index fcd851b1be42c4039697386e6b8e710f6af1f056..0da9d0d4541e49055f29fe779d15913db23369ae 100644 (file)
@@ -30,11 +30,14 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class ShellUtil {
+public final class ShellUtil {
     private static final Logger LOG = LoggerFactory.getLogger(ShellUtil.class);
 
     public static final String NODE_PREFIX = "openflow:";
 
+    private ShellUtil() {
+    }
+
     public static List<OFNode> getAllNodes(final DataBroker broker) {
         List<Node> nodes = null;
         ReadOnlyTransaction tx = broker.newReadOnlyTransaction();
@@ -138,4 +141,4 @@ public class ShellUtil {
         }
         return ofNode;
     }
-}
\ No newline at end of file
+}
index 25de9159b262543e3a9608a5387b9785b6805fc3..bc2fb8a994f9579c1611903f814ce00ef7a6402c 100644 (file)
@@ -21,7 +21,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-class TopologyManagerUtil {
+final class TopologyManagerUtil {
 
     private static final Logger LOG = LoggerFactory.getLogger(TopologyManagerUtil.class);
 
index 93dcc0daf87e6e429903f7cc4b7a618fb6888530..38e8b72afb02c68d02a6baeb6ce2cb92bb44ac18 100644 (file)
@@ -18,7 +18,6 @@ import static org.mockito.Mockito.inOrder;
 import static org.mockito.Mockito.never;
 
 import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.SettableFuture;
 import com.google.common.util.concurrent.Uninterruptibles;
@@ -28,11 +27,8 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import org.mockito.ArgumentCaptor;
 import org.mockito.InOrder;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
@@ -49,7 +45,10 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 
-public class TestUtils {
+public final class TestUtils {
+    private TestUtils() {
+    }
+
     static void verifyMockTx(ReadWriteTransaction mockTx) {
         InOrder inOrder = inOrder(mockTx);
         inOrder.verify(mockTx, atLeast(0)).submit();
@@ -88,12 +87,9 @@ public class TestUtils {
 
     static CountDownLatch setupStubbedSubmit(ReadWriteTransaction mockTx) {
         final CountDownLatch latch = new CountDownLatch(1);
-        doAnswer(new Answer<CheckedFuture<Void, TransactionCommitFailedException>>() {
-            @Override
-            public CheckedFuture<Void, TransactionCommitFailedException> answer(InvocationOnMock invocation) {
-                latch.countDown();
-                return Futures.immediateCheckedFuture(null);
-            }
+        doAnswer(invocation -> {
+            latch.countDown();
+            return Futures.immediateCheckedFuture(null);
         }).when(mockTx).submit();
 
         return latch;
@@ -102,12 +98,9 @@ public class TestUtils {
     @SuppressWarnings("rawtypes")
     static void setupStubbedDeletes(ReadWriteTransaction mockTx, ArgumentCaptor<InstanceIdentifier> deletedLinkIDs,
                                     final CountDownLatch latch) {
-        doAnswer(new Answer<Void>() {
-            @Override
-            public Void answer(InvocationOnMock invocation) {
-                latch.countDown();
-                return null;
-            }
+        doAnswer(invocation -> {
+            latch.countDown();
+            return null;
         }).when(mockTx).delete(eq(LogicalDatastoreType.OPERATIONAL), deletedLinkIDs.capture());
     }
 
index 88bae2285d77d5eb567a63d4e26f4993dce6020d..8b58e5b475adebc5373c1dcaa6addee43e476d7c 100644 (file)
@@ -101,8 +101,8 @@ public class ConnectionContextImpl implements ConnectionContext {
     }
 
     @Override
-    public void setFeatures(final FeaturesReply featuresReply) {
-        this.featuresReply = featuresReply;
+    public void setFeatures(final FeaturesReply newFeaturesReply) {
+        this.featuresReply = newFeaturesReply;
     }
 
     @Override
@@ -186,9 +186,9 @@ public class ConnectionContextImpl implements ConnectionContext {
     }
 
     @Override
-    public void setOutboundQueueHandleRegistration(OutboundQueueHandlerRegistration<OutboundQueueProvider>
-                                                               outboundQueueHandlerRegistration) {
-        this.outboundQueueHandlerRegistration = outboundQueueHandlerRegistration;
+    public void setOutboundQueueHandleRegistration(
+            OutboundQueueHandlerRegistration<OutboundQueueProvider> newRegistration) {
+        this.outboundQueueHandlerRegistration = newRegistration;
     }
 
     private void unregisterOutboundQueue() {
index b41ab16618678676736ae4d90eb7f7c8cfad8963..f1240939eb9c3f9e18a9f5a23415b4f96e1706c5 100644 (file)
@@ -142,7 +142,7 @@ public class HandshakeManagerImpl implements HandshakeManager {
                 @Override
                 public void onSuccess(Void result) {
                     try {
-                        stepByStepVersionSubStep(remoteVersion, lastProposedVersion);
+                        stepByStepVersionSubStep(remoteVersion);
                     } catch (Exception e) {
                         errorHandler.handleException(e);
                         handshakeListener.onHandshakeFailure();
@@ -156,18 +156,18 @@ public class HandshakeManagerImpl implements HandshakeManager {
                 }
             });
         } else {
-            stepByStepVersionSubStep(remoteVersion, lastProposedVersion);
+            stepByStepVersionSubStep(remoteVersion);
         }
     }
 
-    private void stepByStepVersionSubStep(Short remoteVersion, Short lastProposedVersion) throws Exception {
+    private void stepByStepVersionSubStep(Short remoteVersion) throws Exception {
         if (remoteVersion.equals(lastProposedVersion)) {
             postHandshake(lastProposedVersion, getNextXid());
             LOG.trace("ret - OK - switch answered with lastProposedVersion");
         } else {
             checkNegotiationStalling(remoteVersion);
 
-            if (remoteVersion > (lastProposedVersion == null ? highestVersion : this.lastProposedVersion)) {
+            if (remoteVersion > (lastProposedVersion == null ? highestVersion : lastProposedVersion)) {
                 // wait for next version
                 LOG.trace("ret - wait");
             } else {
index fec6491ad64c129b2b9d40d665993b6ea5ad1043..c2582a1d7f08fcd40b1119321a8d163f4b429acc 100644 (file)
@@ -11,6 +11,7 @@ import com.google.common.annotations.VisibleForTesting;
 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.MoreExecutors;
 import io.netty.util.HashedWheelTimer;
 import java.util.Collection;
 import java.util.Collections;
@@ -275,7 +276,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
     public void processReply(final OfHeader ofHeader) {
         messageSpy.spyMessage(
                 ofHeader.getImplementedInterface(),
-                (ofHeader instanceof Error)
+                ofHeader instanceof Error
                         ? MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_FAILURE
                         : MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS);
     }
@@ -284,7 +285,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
     public void processReply(final Xid xid, final List<? extends OfHeader> ofHeaderList) {
         ofHeaderList.forEach(header -> messageSpy.spyMessage(
                 header.getImplementedInterface(),
-                (header instanceof Error)
+                header instanceof Error
                         ? MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_FAILURE
                         : MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS));
     }
@@ -422,7 +423,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
                 LOG.trace("notification offer failed..", throwable);
                 packetInLimiter.releasePermit();
             }
-        });
+        }, MoreExecutors.directExecutor());
     }
 
     @Override
@@ -540,8 +541,8 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
     }
 
     @Override
-    public void registerMastershipWatcher(@Nonnull final ContextChainMastershipWatcher contextChainMastershipWatcher) {
-        this.contextChainMastershipWatcher = contextChainMastershipWatcher;
+    public void registerMastershipWatcher(@Nonnull final ContextChainMastershipWatcher newWatcher) {
+        this.contextChainMastershipWatcher = newWatcher;
     }
 
     @Nonnull
@@ -587,7 +588,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
 
     // TODO: exception handling should be fixed by using custom checked exception, never RuntimeExceptions
     @Override
-    @SuppressWarnings({"checkstyle:IllegalCatch", "checkstyle:AvoidHidingCauseExceptionCheck"})
+    @SuppressWarnings({"checkstyle:IllegalCatch"})
     public void instantiateServiceInstance() {
         lazyTransactionManagerInitialization();
 
@@ -599,8 +600,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
             submitTransaction();
         } catch (final Exception ex) {
             throw new RuntimeException(String.format("Error processing port status messages from device %s: %s",
-                    deviceInfo.toString(),
-                    ex.toString()));
+                    deviceInfo.toString(), ex.toString()), ex);
         }
 
         final Optional<AbstractDeviceInitializer> initializer = deviceInitializerProvider
@@ -616,13 +616,10 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
             } catch (TimeoutException ex) {
                 initialize.cancel(true);
                 throw new RuntimeException(String.format("Failed to initialize device %s in %ss: %s",
-                        deviceInfo.toString(),
-                        String.valueOf(DEVICE_INIT_TIMEOUT / 1000),
-                        ex.toString()));
+                        deviceInfo.toString(), String.valueOf(DEVICE_INIT_TIMEOUT / 1000), ex.toString()), ex);
             } catch (ExecutionException | InterruptedException ex) {
-                throw new RuntimeException(String.format("Device %s cannot be initialized: %s",
-                        deviceInfo.toString(),
-                        ex.toString()));
+                throw new RuntimeException(
+                        String.format("Device %s cannot be initialized: %s", deviceInfo.toString(), ex.toString()), ex);
             }
         } else {
             throw new RuntimeException(String.format("Unsupported version %s for device %s",
index 24870569bbf65e8466d55ba2c80695554e0c6da3..3702c9e2a10f61c2638da7c2a287e7dc4796caf5 100644 (file)
@@ -232,18 +232,18 @@ public class ContextChainImpl implements ContextChain {
         deviceRemovedHandlers.add(deviceRemovedHandler);
     }
 
-    private void changeMastershipState(final ContextChainState contextChainState) {
+    private void changeMastershipState(final ContextChainState newContextChainState) {
         if (ContextChainState.CLOSED.equals(this.contextChainState.get())) {
             return;
         }
 
         boolean propagate = ContextChainState.UNDEFINED.equals(this.contextChainState.get());
-        this.contextChainState.set(contextChainState);
+        this.contextChainState.set(newContextChainState);
 
         if (propagate) {
             contexts.forEach(context -> {
                 if (context.map(ContextChainStateListener.class::isInstance)) {
-                    context.map(ContextChainStateListener.class::cast).onStateAcquired(contextChainState);
+                    context.map(ContextChainStateListener.class::cast).onStateAcquired(newContextChainState);
                 }
             });
         }
index 88b87527d84546ada3637fe08d413c00e22ddab8..af1fa140aed34f605cc5f9a3187e410161803082 100644 (file)
@@ -81,8 +81,8 @@ public class RoleContextImpl implements RoleContext {
     }
 
     @Override
-    public void registerMastershipWatcher(@Nonnull final ContextChainMastershipWatcher contextChainMastershipWatcher) {
-        this.contextChainMastershipWatcher = contextChainMastershipWatcher;
+    public void registerMastershipWatcher(@Nonnull final ContextChainMastershipWatcher newWatcher) {
+        this.contextChainMastershipWatcher = newWatcher;
     }
 
     @Override
index d293d42d542bfa6ca4427538b2276e62dd54380c..d7e2bb8c52cbb663a4da76694aa158e9f3257abe 100644 (file)
@@ -174,8 +174,8 @@ class RpcContextImpl implements RpcContext {
     }
 
     @Override
-    public void registerMastershipWatcher(@Nonnull final ContextChainMastershipWatcher contextChainMastershipWatcher) {
-        this.contextChainMastershipWatcher = contextChainMastershipWatcher;
+    public void registerMastershipWatcher(@Nonnull final ContextChainMastershipWatcher newWatcher) {
+        this.contextChainMastershipWatcher = newWatcher;
     }
 
     @Override
index 763169db8fe474ce57bd738f806b47223ed03ff0..1893770a06b89d7e6a7b007c88b84608d5747dca 100644 (file)
@@ -65,8 +65,8 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
     private final long maximumPollingDelay;
     private final boolean isUsingReconciliationFramework;
     private final AtomicBoolean schedulingEnabled = new AtomicBoolean(true);
-    private final AtomicReference<ListenableFuture<Boolean>> lastDataGathering = new AtomicReference<>();
-    private final AtomicReference<StatisticsPollingService> statisticsPollingService = new AtomicReference<>();
+    private final AtomicReference<ListenableFuture<Boolean>> lastDataGatheringRef = new AtomicReference<>();
+    private final AtomicReference<StatisticsPollingService> statisticsPollingServiceRef = new AtomicReference<>();
     private List<MultipartType> collectingStatType;
     private StatisticsGatheringService<T> statisticsGatheringService;
     private StatisticsGatheringOnTheFlyService<T> statisticsGatheringOnTheFlyService;
@@ -107,8 +107,8 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
     }
 
     @Override
-    public void registerMastershipWatcher(@Nonnull final ContextChainMastershipWatcher contextChainMastershipWatcher) {
-        this.contextChainMastershipWatcher = contextChainMastershipWatcher;
+    public void registerMastershipWatcher(@Nonnull final ContextChainMastershipWatcher newWatcher) {
+        this.contextChainMastershipWatcher = newWatcher;
     }
 
     @Override
@@ -208,7 +208,7 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
             return Futures.immediateFuture(Boolean.TRUE);
         }
 
-        return this.lastDataGathering.updateAndGet(future -> {
+        return this.lastDataGatheringRef.updateAndGet(future -> {
             // write start timestamp to state snapshot container
             StatisticsGatheringUtils.markDeviceStateSnapshotStart(deviceInfo, deviceContext);
 
@@ -282,19 +282,19 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
 
         schedulingEnabled.set(true);
         statisticsPollingService.startAsync();
-        this.statisticsPollingService.set(statisticsPollingService);
+        this.statisticsPollingServiceRef.set(statisticsPollingService);
     }
 
     private ListenableFuture<Void> stopGatheringData() {
         LOG.info("Stopping running statistics gathering for node {}", deviceInfo);
         cancelLastDataGathering();
 
-        return Optional.ofNullable(statisticsPollingService.getAndSet(null)).map(StatisticsPollingService::stop)
+        return Optional.ofNullable(statisticsPollingServiceRef.getAndSet(null)).map(StatisticsPollingService::stop)
                 .orElseGet(() -> Futures.immediateFuture(null));
     }
 
     private void cancelLastDataGathering() {
-        final ListenableFuture<Boolean> future = lastDataGathering.getAndSet(null);
+        final ListenableFuture<Boolean> future = lastDataGatheringRef.getAndSet(null);
 
         if (Objects.nonNull(future) && !future.isDone() && !future.isCancelled()) {
             future.cancel(true);
index da53fe01d7c6cbb3fd09d0eb883c6c81c020ee11..78d9e38235cc7d769eec052ab989f1b46bf74a11 100644 (file)
@@ -14,6 +14,7 @@ import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
 import java.text.SimpleDateFormat;
 import java.util.Collections;
 import java.util.Date;
@@ -102,7 +103,7 @@ public final class StatisticsGatheringUtils {
                              rpcResultIsNull ? "" : rpcResult.getErrors());
                 }
                 return false;
-            }));
+            }), MoreExecutors.directExecutor());
     }
 
     private static boolean processStatistics(final MultipartType type, final List<? extends DataContainer> statistics,
index 6b1578b96d2a53f23a3af429f3bd3ca6da1f2eea..fa304791a092fc6b21b83a4796c3576f635c0a1f 100644 (file)
@@ -43,7 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
  */
 public class MultipartRequestInputFactoryTest {
 
-    private long xid = 42L;
+    private final long xid = 42L;
     private short ofVersion;
 
     @Before
@@ -57,7 +57,7 @@ public class MultipartRequestInputFactoryTest {
         MultipartType mpType = MultipartType.OFPMPDESC;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         checkEmptyBody(mpRqInput.getMultipartRequestBody(), MultipartRequestDescCase.class);
     }
 
@@ -66,7 +66,7 @@ public class MultipartRequestInputFactoryTest {
         final MultipartType mpType = MultipartType.OFPMPFLOW;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
         Assert.assertTrue(mpRqBody instanceof MultipartRequestFlowCase);
 
@@ -91,7 +91,7 @@ public class MultipartRequestInputFactoryTest {
         ofVersion = OFConstants.OFP_VERSION_1_0;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
         Assert.assertTrue(mpRqBody instanceof MultipartRequestFlowCase);
 
@@ -110,7 +110,7 @@ public class MultipartRequestInputFactoryTest {
         MultipartType mpType = MultipartType.OFPMPAGGREGATE;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         checkEmptyBody(mpRqInput.getMultipartRequestBody(), MultipartRequestAggregateCase.class);
     }
 
@@ -119,7 +119,7 @@ public class MultipartRequestInputFactoryTest {
         MultipartType mpType = MultipartType.OFPMPTABLE;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         checkEmptyBody(mpRqInput.getMultipartRequestBody(), MultipartRequestTableCase.class);
     }
 
@@ -128,7 +128,7 @@ public class MultipartRequestInputFactoryTest {
         final MultipartType mpType = MultipartType.OFPMPPORTSTATS;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
         Assert.assertTrue(mpRqBody instanceof MultipartRequestPortStatsCase);
 
@@ -141,7 +141,7 @@ public class MultipartRequestInputFactoryTest {
         final MultipartType mpType = MultipartType.OFPMPQUEUE;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
         Assert.assertTrue(mpRqBody instanceof MultipartRequestQueueCase);
 
@@ -155,7 +155,7 @@ public class MultipartRequestInputFactoryTest {
         final MultipartType mpType = MultipartType.OFPMPGROUP;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
         Assert.assertTrue(mpRqBody instanceof MultipartRequestGroupCase);
 
@@ -168,7 +168,7 @@ public class MultipartRequestInputFactoryTest {
         MultipartType mpType = MultipartType.OFPMPGROUPDESC;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         checkEmptyBody(mpRqInput.getMultipartRequestBody(), MultipartRequestGroupDescCase.class);
     }
 
@@ -177,7 +177,7 @@ public class MultipartRequestInputFactoryTest {
         MultipartType mpType = MultipartType.OFPMPGROUPFEATURES;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         checkEmptyBody(mpRqInput.getMultipartRequestBody(), MultipartRequestGroupFeaturesCase.class);
     }
 
@@ -186,7 +186,7 @@ public class MultipartRequestInputFactoryTest {
         final MultipartType mpType = MultipartType.OFPMPMETER;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
         Assert.assertTrue(mpRqBody instanceof MultipartRequestMeterCase);
 
@@ -199,7 +199,7 @@ public class MultipartRequestInputFactoryTest {
         final MultipartType mpType = MultipartType.OFPMPMETERCONFIG;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
         Assert.assertTrue(mpRqBody instanceof MultipartRequestMeterConfigCase);
 
@@ -213,7 +213,7 @@ public class MultipartRequestInputFactoryTest {
         MultipartType mpType = MultipartType.OFPMPMETERFEATURES;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         checkEmptyBody(mpRqInput.getMultipartRequestBody(), MultipartRequestMeterFeaturesCase.class);
     }
 
@@ -222,7 +222,7 @@ public class MultipartRequestInputFactoryTest {
         final MultipartType mpType = MultipartType.OFPMPTABLEFEATURES;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
         Assert.assertTrue(mpRqBody instanceof MultipartRequestTableFeaturesCase);
 
@@ -236,7 +236,7 @@ public class MultipartRequestInputFactoryTest {
         MultipartType mpType = MultipartType.OFPMPPORTDESC;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         checkEmptyBody(mpRqInput.getMultipartRequestBody(), MultipartRequestPortDescCase.class);
     }
 
@@ -245,11 +245,11 @@ public class MultipartRequestInputFactoryTest {
         MultipartType mpType = MultipartType.OFPMPEXPERIMENTER;
         final MultipartRequestInput mpRqInput =
             (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
-        checkHeader(mpRqInput, mpType, ofVersion);
+        checkHeader(mpRqInput, mpType);
         checkEmptyBody(mpRqInput.getMultipartRequestBody(), MultipartRequestExperimenterCase.class);
     }
 
-    private void checkHeader(MultipartRequestInput mpRqInput, MultipartType mpType, short ofVersion) {
+    private void checkHeader(MultipartRequestInput mpRqInput, MultipartType mpType) {
         Assert.assertFalse(mpRqInput.getFlags().isOFPMPFREQMORE());
         Assert.assertEquals(ofVersion, mpRqInput.getVersion().shortValue());
         Assert.assertEquals(mpType, mpRqInput.getType());
index 6b2e76408ad10ad15667bb05246b6ea739fd140c..bbcc12ea4e0ab4672e4238b61c28b29c339d948c 100644 (file)
@@ -37,7 +37,6 @@ import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
@@ -145,8 +144,9 @@ public class DeviceContextImplTest {
     private OutboundQueueProvider outboundQueueProvider;
     @Mock
     private ConnectionAdapter connectionAdapter;
-    private NodeId nodeId = new NodeId("h2g2:42");
-    private KeyedInstanceIdentifier<Node, NodeKey> nodeKeyIdent = DeviceStateUtil.createNodeInstanceIdentifier(nodeId);
+    private final NodeId nodeId = new NodeId("h2g2:42");
+    private final KeyedInstanceIdentifier<Node, NodeKey> nodeKeyIdent =
+            DeviceStateUtil.createNodeInstanceIdentifier(nodeId);
     @Mock
     private TranslatorLibrary translatorLibrary;
     @Mock
@@ -258,7 +258,7 @@ public class DeviceContextImplTest {
 
     @Test
     public void testGetReadTransaction() {
-        final ReadTransaction readTx = deviceContext.getReadTransaction();
+        readTx = deviceContext.getReadTransaction();
         assertNotNull(readTx);
         assertEquals(this.readTx, readTx);
     }
index 152031c1ac7b87b11c15b1705724395b8de66e20..8b016e982a7272a7477c6c111bc222c34b6ba59d 100644 (file)
@@ -35,6 +35,7 @@ public class ClearStatsCommandProviderTest extends AbstractKarafTest {
     };
     private MessageIntelligenceAgency mi5;
 
+    @Override
     public void doSetUp() {
         clearStatsCommandProvider = new ClearStatsCommandProvider();
         mi5 = OpenFlowPluginProviderImpl.getMessageIntelligenceAgency();
@@ -64,7 +65,7 @@ public class ClearStatsCommandProviderTest extends AbstractKarafTest {
      */
     @Test
     public void testDoExecute_dirty() throws Exception {
-        final MessageIntelligenceAgency mi5 = OpenFlowPluginProviderImpl.getMessageIntelligenceAgency();
+        mi5 = OpenFlowPluginProviderImpl.getMessageIntelligenceAgency();
         Assert.assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION));
         mi5.spyMessage(OfHeader.class, MessageSpy.StatisticsGroup.FROM_SWITCH);
         Assert.assertFalse(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION));
@@ -72,4 +73,4 @@ public class ClearStatsCommandProviderTest extends AbstractKarafTest {
         clearStatsCommandProvider.execute(cmdSession);
         Assert.assertTrue(checkNoActivity(mi5.provideIntelligence(), CHECK_NO_ACTIVITY_FUNCTION));
     }
-}
\ No newline at end of file
+}
index 9a6c2c141cfa09099da09a5f67759b2298e7b064..b9be54d89420ed90961601e35de37e8f015d5698 100644 (file)
@@ -107,7 +107,7 @@ public class DeviceFlowRegistryImplTest {
                 .build();
 
         final Map<FlowRegistryKey, FlowDescriptor> allFlowDescriptors = fillRegistry(path, flowCapableNode);
-        final FlowRegistryKey key = FlowRegistryKeyFactory.create(OFConstants.OFP_VERSION_1_3, flow);
+        key = FlowRegistryKeyFactory.create(OFConstants.OFP_VERSION_1_3, flow);
 
         InOrder order = inOrder(dataBroker, readOnlyTransaction);
         order.verify(dataBroker).newReadOnlyTransaction();
@@ -240,7 +240,7 @@ public class DeviceFlowRegistryImplTest {
     @Test
     public void testForEach() throws Exception {
         final AtomicInteger counter = new AtomicInteger(0);
-        deviceFlowRegistry.forEach(key -> counter.incrementAndGet());
+        deviceFlowRegistry.forEach(k -> counter.incrementAndGet());
         Assert.assertEquals(1, counter.get());
     }
 
index cebe9bfb2c0cbccbeaeab6b7c13a0b29c69ce0d6..5e0b46f567dacb1e39bc7edf24f310e0450b42a0 100644 (file)
@@ -78,7 +78,7 @@ public class StatisticsContextImplTest extends StatisticsContextImpMockInitiatio
     @Test
     @SuppressWarnings("checkstyle:IllegalCatch")
     public void testClose() throws Exception {
-        final StatisticsContextImpl<MultipartReply> statisticsContext =
+        statisticsContext =
                 new StatisticsContextImpl<>(mockedDeviceContext,
                                             convertorManager,
                                             MultipartWriterProviderFactory
index edf9b715cdba9e9245796075c12bcb467e60afd9..359217c3a368c17ebab4f02937bbc8a4645955f8 100644 (file)
@@ -131,12 +131,11 @@ public class StatisticsManagerImplTest {
             .thenReturn(new DeviceFlowRegistryImpl(OFConstants.OFP_VERSION_1_3, dataBroker, nodePath));
         when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
         when(mockedDeviceContext.getMultiMsgCollector(
-                Matchers.<RequestContext<List<MultipartReply>>>any())).thenAnswer(
+            Matchers.<RequestContext<List<MultipartReply>>>any())).thenAnswer(
                 invocation -> {
                     currentRequestContext = (RequestContext<List<MultipartReply>>) invocation.getArguments()[0];
                     return multiMagCollector;
-                }
-        );
+                });
         when(rpcProviderRegistry.addRpcImplementation(
                 Matchers.eq(StatisticsManagerControlService.class),
                 Matchers.<StatisticsManagerControlService>any())).thenReturn(serviceControlRegistration);
index cca27841a850b274406c2c2c9712bb0cc99e491d..8d6092cdc6ea816c7b9edee32b250fcc21bbe67b 100644 (file)
@@ -148,8 +148,8 @@ public class AbstractCompatibleStatServiceTest extends AbstractStatsServiceTest
                 service.handleAndNotify(input, notificationPublishService);
 
         Assert.assertTrue(resultFuture.isDone());
-        final RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput> rpcResult = resultFuture.get();
-        Assert.assertTrue(rpcResult.isSuccessful());
+        final RpcResult<GetAggregateFlowStatisticsFromFlowTableForAllFlowsOutput> result = resultFuture.get();
+        Assert.assertTrue(result.isSuccessful());
         Assert.assertEquals(MultipartType.OFPMPAGGREGATE, requestInput.getValue().getType());
         Mockito.verify(notificationPublishService, Mockito.timeout(500))
                 .offerNotification(Matchers.any(AggregateFlowStatisticsUpdate.class));
index 0e614d7d40904b2ee6df43d423423b5193327a56..53c372d1275912560e7986e33daead6f1ea6ff4f 100644 (file)
@@ -69,8 +69,6 @@ public class PacketReceivedTranslatorTest {
     @Mock
     DeviceInfo deviceInfo;
     @Mock
-    List<PhyPort> phyPorts;
-    @Mock
     PhyPort phyPort;
 
     ConvertorManager convertorManager;