Make methods static 43/29643/1
authorRobert Varga <rovarga@cisco.com>
Fri, 13 Nov 2015 11:31:06 +0000 (12:31 +0100)
committerRobert Varga <rovarga@cisco.com>
Fri, 13 Nov 2015 11:31:30 +0000 (12:31 +0100)
Private methods which do not touch object state can be made static.

Change-Id: I4f5a7e6215c7570660ee797f4e694745844f72e7
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShard.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipStatisticsTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java

index 094bb4a..3cb4b3c 100644 (file)
@@ -270,7 +270,7 @@ public class DatastoreContextIntrospector {
         return updated;
     }
 
-    private ArrayList<String> getSortedKeysByDatastoreType(Collection<String> inKeys,
+    private static ArrayList<String> getSortedKeysByDatastoreType(Collection<String> 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.
index 058ab49..1f31d12 100644 (file)
@@ -435,7 +435,7 @@ class EntityOwnershipShard extends Shard {
         }
     }
 
-    private Collection<String> getCandidateNames(MapEntryNode entity) {
+    private static Collection<String> getCandidateNames(MapEntryNode entity) {
         Collection<MapEntryNode> candidates = ((MapNode) entity.getChild(CANDIDATE_NODE_ID).get()).getValue();
         Collection<String> candidateNames = new ArrayList<>(candidates.size());
         for(MapEntryNode candidate: candidates) {
index 5f935a6..247185c 100644 (file)
@@ -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<DatastoreContext> answer = new Answer<DatastoreContext>() {
             @Override
index 7374de3..de299c9 100644 (file)
@@ -130,7 +130,7 @@ public class EntityOwnershipStatisticsTest extends AbstractActorTest {
 
     }
 
-    private void assertStatistics(Map<String, Map<String, Long>> statistics, String memberName, long val) {
+    private static void assertStatistics(Map<String, Map<String, Long>> statistics, String memberName, long val) {
         assertEquals(val, statistics.get(ENTITY_TYPE).get(memberName).longValue());
     }
 
index 50db591..1054f34 100644 (file)
@@ -37,7 +37,7 @@ public class LeastLoadedCandidateSelectionStrategyTest {
 
     }
 
-    private Map<String, Long> prepareStatistics(long... count){
+    private static Map<String, Long> prepareStatistics(long... count){
         Map<String, Long> statistics = new HashMap<>();
         for(int i=0;i<count.length;i++){
             statistics.put("member-" + (i+1), count[i]);
@@ -45,7 +45,7 @@ public class LeastLoadedCandidateSelectionStrategyTest {
         return statistics;
     }
 
-    private Collection<String> prepareViableCandidates(int count){
+    private static Collection<String> prepareViableCandidates(int count){
         Collection<String> viableCandidates = new ArrayList<>();
         for(int i=0;i<count;i++){
             viableCandidates.add("member-" + (i+1));