Make VpnUtil.getVpnListForVpnInterface() static 42/77942/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 19 Nov 2018 12:40:54 +0000 (13:40 +0100)
committerRobert Varga <nite@hq.sk>
Fri, 23 Nov 2018 18:08:16 +0000 (18:08 +0000)
This method is not touching any state, make it static and adjust
the sole caller.

Change-Id: I44ab35b0a7b3419663d516d817a549e72a62e0c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInterfaceManager.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnUtil.java

index 62b2180aff323232918b48173ac7b2c16f069894..d681cf60edb09168e8554c4e788ba34e766b31d0 100755 (executable)
@@ -1571,10 +1571,10 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
         boolean isVpnInstanceUpdate = Boolean.FALSE;
         final VpnInterfaceKey key = identifier.firstKeyOf(VpnInterface.class);
         final String interfaceName = key.getName();
-        List<String> oldVpnList = vpnUtil.getVpnListForVpnInterface(original);
+        List<String> oldVpnList = VpnUtil.getVpnListForVpnInterface(original);
         List<String> oldVpnListCopy = new ArrayList<>();
         oldVpnListCopy.addAll(oldVpnList);
-        List<String> newVpnList = vpnUtil.getVpnListForVpnInterface(update);
+        List<String> newVpnList = VpnUtil.getVpnListForVpnInterface(update);
         List<String> newVpnListCopy = new ArrayList<>();
         newVpnListCopy.addAll(newVpnList);
 
index 989a466a4ab723bd01bbe176169b6b28cd6c84f2..f5655253986a504ee1827b9b4e3458b728454136 100644 (file)
@@ -2300,7 +2300,7 @@ public final class VpnUtil {
         return VpnConstants.IP_MONITOR_JOB_PREFIX_KEY + "-" + vpnName + "-" + ip;
     }
 
-    public List<String> getVpnListForVpnInterface(VpnInterface vpnInter) {
+    public static List<String> getVpnListForVpnInterface(VpnInterface vpnInter) {
         return requireNonNullElse(vpnInter.getVpnInstanceNames(), Collections.<VpnInstanceNames>emptyList()).stream()
                 .map(VpnInstanceNames::getVpnName).collect(Collectors.toList());
     }