From: Robert Varga Date: Fri, 12 Feb 2016 12:08:22 +0000 (+0100) Subject: Make methods static X-Git-Tag: release/boron~384 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=922e20f44a002cf6eec1790f47e1bb68096ef8d9 Make methods static These private methods can be made static, let's do that. Change-Id: I275e465f3424ae87f7a2a5ddaaca1f09c5072685 Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorRecoverySupport.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorRecoverySupport.java index 3ac1e79674..d4f6247855 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorRecoverySupport.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorRecoverySupport.java @@ -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); } } diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java index e1b162fcf1..6eded7cc63 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/LeadershipTransferIntegrationTest.java @@ -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 notifierActor) { + private static void assertNullLeaderIdChange(TestActorRef notifierActor) { LeaderStateChanged change = expectFirstMatching(notifierActor, LeaderStateChanged.class); assertNull("Expected null leader Id", change.getLeaderId()); } diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorContextImplTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorContextImplTest.java index a879fd7ea2..fdc72ed573 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorContextImplTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorContextImplTest.java @@ -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); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java index 47b1413db7..6d102dbede 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorServerConfigurationSupportTest.java @@ -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); } diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/InMemorySnapshotStore.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/InMemorySnapshotStore.java index 81b2d7844f..bf13089735 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/InMemorySnapshotStore.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/InMemorySnapshotStore.java @@ -122,7 +122,7 @@ public class InMemorySnapshotStore extends SnapshotStore { return Futures.successful(Option.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(); }