Fixup static method warnings 99/61099/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 3 Aug 2017 09:34:07 +0000 (11:34 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 4 Aug 2017 03:28:44 +0000 (03:28 +0000)
- a method can be made static
- invocation of static methods should not go through an instance

Change-Id: I9380a17432340c75fd94bd01c9dc5bb5cdbd8156
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java

index 1542a33..a4a7f55 100644 (file)
@@ -73,7 +73,7 @@ public class LeadershipTransferIntegrationTest extends AbstractRaftActorIntegrat
         testLog.info("testLeaderTransferOnShutDown ending");
     }
 
-    private void sendShutDown(ActorRef actor) throws Exception {
+    private void sendShutDown(final ActorRef actor) throws Exception {
         testLog.info("sendShutDown for {} starting", actor.path());
 
         FiniteDuration duration = FiniteDuration.create(5, TimeUnit.SECONDS);
@@ -199,12 +199,12 @@ public class LeadershipTransferIntegrationTest extends AbstractRaftActorIntegrat
         testLog.info("createRaftActors starting");
     }
 
-    private static void verifyRaftState(ActorRef raftActor, final RaftState expState) {
+    private static void verifyRaftState(final ActorRef raftActor, final RaftState expState) {
         verifyRaftState(raftActor, rs -> assertEquals("getRaftState", expState.toString(), rs.getRaftState()));
     }
 
-    private void verifyLeaderStateChangedMessages(TestActorRef<MessageCollectorActor> notifierActor,
-            String... expLeaderIds) {
+    private static void verifyLeaderStateChangedMessages(final TestActorRef<MessageCollectorActor> notifierActor,
+            final String... expLeaderIds) {
         List<LeaderStateChanged> leaderStateChanges = expectMatching(notifierActor, LeaderStateChanged.class,
                 expLeaderIds.length);
 
index ebe5498..50d4e02 100644 (file)
@@ -311,7 +311,7 @@ public class Shard extends RaftActor {
 
             if (message instanceof RequestEnvelope) {
                 handleRequestEnvelope((RequestEnvelope)message);
-            } else if (requestMessageAssembler.isHandledMessage(message)) {
+            } else if (MessageAssembler.isHandledMessage(message)) {
                 handleRequestAssemblerMessage(message);
             } else if (message instanceof ConnectClientRequest) {
                 handleConnectClient((ConnectClientRequest)message);
@@ -373,7 +373,7 @@ public class Shard extends RaftActor {
         }
     }
 
-    private void handleRequestAssemblerMessage(Object message) {
+    private void handleRequestAssemblerMessage(final Object message) {
         dispatchers.getDispatcher(DispatcherType.Serialization).execute(() -> {
             JavaSerializer.currentSystem().value_$eq((ExtendedActorSystem) context().system());
             requestMessageAssembler.handleMessage(message, self());

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