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 094bb4a9e1d323debd66f207cab3626217c93116..3cb4b3ccf14732eeaee5cc3b7e541d8c448b20f6 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 058ab498d965cfba3168fdfaf2cb6860bf2bce48..1f31d122cd271ac4824bb1d490c579233d1d51cd 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 5f935a6aa61e1e528ad7b7ca77faba5d274f8ff4..247185cf53cdd5f2eb25ab7b6d542afc92944635 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 7374de3698bceb0f61e48af8c65305df7c810c33..de299c99f7f7a1ebeb1f25ef7c4139408ad9c189 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 50db591a19e86307db54784afd4f1f82331828dd..1054f346f9ba5f77dee9a97ab8c6c2fe251b4c3e 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));