Make methods static 55/34555/2
authorRobert Varga <rovarga@cisco.com>
Fri, 12 Feb 2016 12:08:22 +0000 (13:08 +0100)
committerRobert Varga <rovarga@cisco.com>
Sat, 13 Feb 2016 10:08:03 +0000 (11:08 +0100)
These private methods can be made static, let's do that.

Change-Id: I275e465f3424ae87f7a2a5ddaaca1f09c5072685
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorRecoverySupport.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorContextImplTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/InMemorySnapshotStore.java

index 3ac1e796741466562b9540217e6d534ceefabfa7..d4f62478554e9e3edb724a89f3d2367d2f5fc299 100644 (file)
@@ -267,7 +267,7 @@ class RaftActorRecoverySupport {
                  replicatedLog().getSnapshotTerm(), replicatedLog().size());
     }
 
                  replicatedLog().getSnapshotTerm(), replicatedLog().size());
     }
 
-    private boolean isServerConfigurationPayload(ReplicatedLogEntry repLogEntry){
+    private static boolean isServerConfigurationPayload(ReplicatedLogEntry repLogEntry){
         return (repLogEntry.getData() instanceof ServerConfigurationPayload);
     }
 }
         return (repLogEntry.getData() instanceof ServerConfigurationPayload);
     }
 }
index e1b162fcf1f27d12dda6e19e516d08839998ecb6..6eded7cc63f00a207f3acfa337e1561d63fe2864 100644 (file)
@@ -166,7 +166,7 @@ public class LeadershipTransferIntegrationTest extends AbstractRaftActorIntegrat
         testLog.info("createRaftActors starting");
     }
 
         testLog.info("createRaftActors starting");
     }
 
-    private void verifyRaftState(ActorRef raftActor, final RaftState expState) throws Throwable {
+    private static void verifyRaftState(ActorRef raftActor, final RaftState expState) throws Throwable {
         Timeout timeout = new Timeout(500, TimeUnit.MILLISECONDS);
         Throwable lastError = null;
         Stopwatch sw = Stopwatch.createStarted();
         Timeout timeout = new Timeout(500, TimeUnit.MILLISECONDS);
         Throwable lastError = null;
         Stopwatch sw = Stopwatch.createStarted();
@@ -185,7 +185,7 @@ public class LeadershipTransferIntegrationTest extends AbstractRaftActorIntegrat
         throw lastError;
     }
 
         throw lastError;
     }
 
-    private void assertNullLeaderIdChange(TestActorRef<MessageCollectorActor> notifierActor) {
+    private static void assertNullLeaderIdChange(TestActorRef<MessageCollectorActor> notifierActor) {
         LeaderStateChanged change = expectFirstMatching(notifierActor, LeaderStateChanged.class);
         assertNull("Expected null leader Id", change.getLeaderId());
     }
         LeaderStateChanged change = expectFirstMatching(notifierActor, LeaderStateChanged.class);
         assertNull("Expected null leader Id", change.getLeaderId());
     }
index a879fd7ea2c961c7ed0564c281b4dfa3efe36a80..fdc72ed573e2350e18d34824e3d28d99c3e1d72a 100644 (file)
@@ -118,7 +118,7 @@ public class RaftActorContextImplTest extends AbstractActorTest {
         assertEquals("isVotingMember", false, context.isVotingMember());
     }
 
         assertEquals("isVotingMember", false, context.isVotingMember());
     }
 
-    private void verifyPeerInfo(RaftActorContextImpl context, String peerId, Boolean voting) {
+    private static void verifyPeerInfo(RaftActorContextImpl context, String peerId, Boolean voting) {
         PeerInfo peerInfo = context.getPeerInfo(peerId);
         if(voting != null) {
             assertNotNull("Expected peer " + peerId, peerInfo);
         PeerInfo peerInfo = context.getPeerInfo(peerId);
         if(voting != null) {
             assertNotNull("Expected peer " + peerId, peerInfo);
index 47b1413db735f7b646558d7698380b2c6a38a58f..6d102dbededa9bf7ce3978a6998845cd92226a7c 100644 (file)
@@ -838,11 +838,11 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest {
         assertEquals("getStatus", ServerChangeStatus.NOT_SUPPORTED, removeServerReply.getStatus());
     }
 
         assertEquals("getStatus", ServerChangeStatus.NOT_SUPPORTED, removeServerReply.getStatus());
     }
 
-    private ServerInfo votingServer(String id) {
+    private static ServerInfo votingServer(String id) {
         return new ServerInfo(id, true);
     }
 
         return new ServerInfo(id, true);
     }
 
-    private ServerInfo nonVotingServer(String id) {
+    private static ServerInfo nonVotingServer(String id) {
         return new ServerInfo(id, false);
     }
 
         return new ServerInfo(id, false);
     }
 
index 81b2d7844fc6546cee60d38343fde1390f237187..bf130897354d12b9a89d75730f7353ba9135526c 100644 (file)
@@ -122,7 +122,7 @@ public class InMemorySnapshotStore extends SnapshotStore {
         return Futures.successful(Option.<SelectedSnapshot>none());
     }
 
         return Futures.successful(Option.<SelectedSnapshot>none());
     }
 
-    private boolean matches(StoredSnapshot snapshot, SnapshotSelectionCriteria criteria) {
+    private static boolean matches(StoredSnapshot snapshot, SnapshotSelectionCriteria criteria) {
         return snapshot.metadata.sequenceNr() <= criteria.maxSequenceNr() &&
                 snapshot.metadata.timestamp() <= criteria.maxTimestamp();
     }
         return snapshot.metadata.sequenceNr() <= criteria.maxSequenceNr() &&
                 snapshot.metadata.timestamp() <= criteria.maxTimestamp();
     }