From: Robert Varga Date: Fri, 13 Nov 2015 11:31:06 +0000 (+0100) Subject: Make methods static X-Git-Tag: release/beryllium~165 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=a05824023cb4f527ed38eacb78dda2ee1424a3ef Make methods static Private methods which do not touch object state can be made static. Change-Id: I4f5a7e6215c7570660ee797f4e694745844f72e7 Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java index 094bb4a9e1..3cb4b3ccf1 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java @@ -270,7 +270,7 @@ public class DatastoreContextIntrospector { return updated; } - private ArrayList getSortedKeysByDatastoreType(Collection inKeys, + private static ArrayList getSortedKeysByDatastoreType(Collection inKeys, final String dataStoreTypePrefix) { // Sort the property keys by putting the names prefixed with the data store type last. This // is done so data store specific settings are applied after global settings. diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShard.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShard.java index 058ab498d9..1f31d122cd 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShard.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShard.java @@ -435,7 +435,7 @@ class EntityOwnershipShard extends Shard { } } - private Collection getCandidateNames(MapEntryNode entity) { + private static Collection getCandidateNames(MapEntryNode entity) { Collection candidates = ((MapNode) entity.getChild(CANDIDATE_NODE_ID).get()).getValue(); Collection candidateNames = new ArrayList<>(candidates.size()); for(MapEntryNode candidate: candidates) { diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java index 5f935a6aa6..247185cf53 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java @@ -658,7 +658,7 @@ public class DistributedDataStoreRemotingIntegrationTest { followerTestKit.doCommit(rwTx.ready()); } - private void sendDatastoreContextUpdate(DistributedDataStore dataStore, final Builder builder) { + private static void sendDatastoreContextUpdate(DistributedDataStore dataStore, final Builder builder) { DatastoreContextFactory mockContextFactory = Mockito.mock(DatastoreContextFactory.class); Answer answer = new Answer() { @Override diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipStatisticsTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipStatisticsTest.java index 7374de3698..de299c99f7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipStatisticsTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipStatisticsTest.java @@ -130,7 +130,7 @@ public class EntityOwnershipStatisticsTest extends AbstractActorTest { } - private void assertStatistics(Map> statistics, String memberName, long val) { + private static void assertStatistics(Map> statistics, String memberName, long val) { assertEquals(val, statistics.get(ENTITY_TYPE).get(memberName).longValue()); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java index 50db591a19..1054f346f9 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java @@ -37,7 +37,7 @@ public class LeastLoadedCandidateSelectionStrategyTest { } - private Map prepareStatistics(long... count){ + private static Map prepareStatistics(long... count){ Map statistics = new HashMap<>(); for(int i=0;i prepareViableCandidates(int count){ + private static Collection prepareViableCandidates(int count){ Collection viableCandidates = new ArrayList<>(); for(int i=0;i