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 3ac1e79..d4f6247 100644 (file)
@@ -267,7 +267,7 @@ class RaftActorRecoverySupport {
                  replicatedLog().getSnapshotTerm(), replicatedLog().size());
     }
 
-    private boolean isServerConfigurationPayload(ReplicatedLogEntry repLogEntry){
+    private static boolean isServerConfigurationPayload(ReplicatedLogEntry repLogEntry){
         return (repLogEntry.getData() instanceof ServerConfigurationPayload);
     }
 }
index e1b162f..6eded7c 100644 (file)
@@ -166,7 +166,7 @@ public class LeadershipTransferIntegrationTest extends AbstractRaftActorIntegrat
         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();
@@ -185,7 +185,7 @@ public class LeadershipTransferIntegrationTest extends AbstractRaftActorIntegrat
         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());
     }
index a879fd7..fdc72ed 100644 (file)
@@ -118,7 +118,7 @@ public class RaftActorContextImplTest extends AbstractActorTest {
         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);
index 47b1413..6d102db 100644 (file)
@@ -838,11 +838,11 @@ public class RaftActorServerConfigurationSupportTest extends AbstractActorTest {
         assertEquals("getStatus", ServerChangeStatus.NOT_SUPPORTED, removeServerReply.getStatus());
     }
 
-    private ServerInfo votingServer(String id) {
+    private static ServerInfo votingServer(String id) {
         return new ServerInfo(id, true);
     }
 
-    private ServerInfo nonVotingServer(String id) {
+    private static ServerInfo nonVotingServer(String id) {
         return new ServerInfo(id, false);
     }
 
index 81b2d78..bf13089 100644 (file)
@@ -122,7 +122,7 @@ public class InMemorySnapshotStore extends SnapshotStore {
         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();
     }