Make potentially-static methods as such 52/91852/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 4 Aug 2020 12:03:11 +0000 (14:03 +0200)
committerHema Gopalakrishnan <hema.gopalkrishnan@ericsson.com>
Wed, 12 Aug 2020 18:37:40 +0000 (18:37 +0000)
Eclipse is pointing a number of methods as candidates for being
static, mark them as such.

Change-Id: I69068433b48b49bb3e5b3ee21b6e26f2d6c6ce77
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
cloudscaler/impl/src/main/java/org/opendaylight/genius/cloudscaler/rpcservice/CloudscalerRpcServiceImpl.java
cloudscaler/impl/src/main/java/org/opendaylight/genius/cloudscaler/rpcservice/ComputeNodeManager.java
cloudscaler/impl/src/test/java/org/opendaylight/genius/cloudscaler/tests/CloudScalerServiceTest.java

index b4a55573eeb5eedfbc2b388345bb8dc0f31e68f8..6ae0192f4724720ceffa2514d90229d5f1879b35 100644 (file)
@@ -233,7 +233,7 @@ public class CloudscalerRpcServiceImpl implements CloudscalerRpcService {
         return Futures.immediateFuture(DONE_RPC_RESPONSE);
     }
 
-    private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network
+    private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network
             .topology.rev131021.network.topology.topology.Node> buildOvsdbNodeId(ComputeNode computeNode) {
         return InstanceIdentifier
                 .create(NetworkTopology.class)
@@ -244,7 +244,7 @@ public class CloudscalerRpcServiceImpl implements CloudscalerRpcService {
                                 .network.topology.topology.NodeKey(new NodeId(computeNode.getNodeid())));
     }
 
-    private InstanceIdentifier<Node> buildOpenflowNodeIid(ComputeNode computeNode) {
+    private static InstanceIdentifier<Node> buildOpenflowNodeIid(ComputeNode computeNode) {
         return InstanceIdentifier.builder(Nodes.class)
                 .child(Node.class, new NodeKey(
                         new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId(
index 8d28b65af0b8901e4ec416c8e17cdd34346d3db0..3082f067430ad492dd7e8858dc466add147b3628 100644 (file)
@@ -146,7 +146,7 @@ public class ComputeNodeManager {
                 .build();
     }
 
-    private Uint64 getDpnIdFromBridge(OvsdbBridgeAugmentation bridgeAugmentation) {
+    private static Uint64 getDpnIdFromBridge(OvsdbBridgeAugmentation bridgeAugmentation) {
         if (bridgeAugmentation.getDatapathId() == null) {
             return Uint64.ZERO;
         }
@@ -166,7 +166,8 @@ public class ComputeNodeManager {
     }
 
 
-    private void logErrorIfComputeNodeIsAlreadyTaken(Uint64 datapathid, String nodeId, Optional<ComputeNode> optional) {
+    private static void logErrorIfComputeNodeIsAlreadyTaken(Uint64 datapathid, String nodeId,
+            Optional<ComputeNode> optional) {
         ComputeNode existingNode = optional.get();
         if (!Objects.equals(existingNode.getNodeid(), nodeId)) {
             LOG.error("ComputeNodeManager Compute is already connected by compute {}", existingNode);
@@ -177,7 +178,7 @@ public class ComputeNodeManager {
         }
     }
 
-    private InstanceIdentifier<Node> getWildcardPath() {
+    private static InstanceIdentifier<Node> getWildcardPath() {
         return InstanceIdentifier
                 .create(NetworkTopology.class)
                 .child(Topology.class, new TopologyKey(new TopologyId("ovsdb:1")))
index d16ad3618e77ab22de7a4a2958b0b098b631f1ba..66b68cd87b112256b9d124f758cb9d6eebdb7a06 100644 (file)
@@ -117,20 +117,20 @@ public class CloudScalerServiceTest {
     public CloudScalerServiceTest() {
     }
 
-    private InstanceIdentifier<ComputeNode> buildComputeNodeIid(String computeName) {
+    private static InstanceIdentifier<ComputeNode> buildComputeNodeIid(String computeName) {
         return InstanceIdentifier.builder(ComputeNodes.class)
                 .child(ComputeNode.class, new ComputeNodeKey(computeName))
                 .build();
     }
 
-    private InstanceIdentifier<Node> buildNodeId(String nodeId) {
+    private static InstanceIdentifier<Node> buildNodeId(String nodeId) {
         return InstanceIdentifier
                 .create(NetworkTopology.class)
                 .child(Topology.class, new TopologyKey(new TopologyId("ovsdb:1")))
                 .child(Node.class, new NodeKey(new NodeId(nodeId)));
     }
 
-    private Node buildNode(String nodeId, String computeName, String datapathid) {
+    private static Node buildNode(String nodeId, String computeName, String datapathid) {
         NodeBuilder nodeBuilder = new NodeBuilder();
         nodeBuilder.setNodeId(new NodeId(nodeId));
         OvsdbBridgeAugmentationBuilder bridge = new OvsdbBridgeAugmentationBuilder();
@@ -139,11 +139,11 @@ public class CloudScalerServiceTest {
         otherConfigsBuilder.setBridgeOtherConfigValue(computeName);
         bridge.setDatapathId(new DatapathId(datapathid));
         bridge.setBridgeOtherConfigs(Lists.newArrayList(otherConfigsBuilder.build()));
-        nodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, bridge.build());
+        nodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class,bridge.build());
         return nodeBuilder.build();
     }
 
-    private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node>
+    private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node>
         buildOpenflowNodeIid(Uint64 dpnid) {
         return InstanceIdentifier.builder(Nodes.class)
                 .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
@@ -152,7 +152,7 @@ public class CloudScalerServiceTest {
                                 "openflow:" + dpnid.toString()))).build();
     }
 
-    private org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node buildOpenflowNode(
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node buildOpenflowNode(
             Uint64 dpnId) {
         org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder nodeBuilder
                 = new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder();
@@ -199,7 +199,7 @@ public class CloudScalerServiceTest {
                 CONFIGURATION, buildComputeNodeIid(COMPUTE2)).get().isTombstoned());
     }
 
-    private ComputeNode buildComputeNode(String nodeid1, BigInteger dpn1, String compute1) {
+    private static ComputeNode buildComputeNode(String nodeid1, BigInteger dpn1, String compute1) {
         return new ComputeNodeBuilder()
                 .setComputeName(compute1)
                 .setDpnid(dpn1)
@@ -251,7 +251,7 @@ public class CloudScalerServiceTest {
         AWAITER.until(() -> nodesRecoverd.contains(DPN1));
     }
 
-    private BridgeRefEntry buildBridgeRefEntry(Uint64 dpnId, String nodeId) {
+    private static BridgeRefEntry buildBridgeRefEntry(Uint64 dpnId, String nodeId) {
         return new BridgeRefEntryBuilder()
             .setDpid(dpnId)
             .setBridgeReference(new OvsdbBridgeRef(buildNodeIid(nodeId)))