Full <> clean-up
authorStephen Kitt <skitt@redhat.com>
Mon, 2 Nov 2015 10:12:12 +0000 (11:12 +0100)
committerStephen Kitt <skitt@redhat.com>
Mon, 2 Nov 2015 16:24:00 +0000 (17:24 +0100)
Change-Id: I23ce78b0cb4d2f253bc2d0ea8fe4833ff099e8b2
Signed-off-by: Stephen Kitt <skitt@redhat.com>
19 files changed:
openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java
openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/SouthboundMapper.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/ConfigActivator.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/arp/Arp.java
openstack/net-virt-providers/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/EgressAclServiceTest.java
openstack/net-virt-providers/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/IngressAclServiceTest.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/ConfigActivator.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/NeutronCacheUtils.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/SecurityServicesImpl.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/SouthboundImpl.java
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/LBaaSPoolHandlerTest.java
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/LBaaSPoolMemberHandlerTest.java
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/NeutronCacheUtilsTest.java
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/PortHandlerTest.java
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/SouthboundHandlerTest.java
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3AdapterTest.java
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/impl/SecurityServicesImplTest.java
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/impl/TenantNetworkManagerImplTest.java
openstack/net-virt/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/impl/VlanConfigurationCacheImplTest.java

index ca01742efcd6357e448bda8b4236e590b5ad834b..ef8b1e52dde286b8e9193a09826d7a1b5e7f66d7 100644 (file)
@@ -400,7 +400,7 @@ public class NetvirtIT extends AbstractMdsalTestBase {
     }
 
     private List<ProtocolEntry> createMdsalProtocols() {
-        List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
+        List<ProtocolEntry> protocolList = new ArrayList<>();
         ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
                 SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
         protocolList.add(new ProtocolEntryBuilder().
index 0ca89b042fca2ac984727b8f087ae409a44a9cb3..03b19a8bbd10e6b9cadc54fecb6fe16774dbc0e1 100644 (file)
@@ -190,7 +190,7 @@ public class SouthboundMapper {
     }
 
     public static Set<String> createOvsdbBridgeProtocols(OvsdbBridgeAugmentation ovsdbBridgeNode) {
-        Set<String> protocols = new HashSet<String>();
+        Set<String> protocols = new HashSet<>();
         if (ovsdbBridgeNode.getProtocolEntry() != null && ovsdbBridgeNode.getProtocolEntry().size() > 0) {
             for (ProtocolEntry protocol : ovsdbBridgeNode.getProtocolEntry()) {
                 if (SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()) != null) {
index 2b98a0f79df0925a64c99a971afb9a2d49d4ee99..03fe16096fcbbbe4a8b975a176a4f9476f9e97ce 100644 (file)
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
 
 public class ConfigActivator implements BundleActivator {
     private static final Logger LOG = LoggerFactory.getLogger(ConfigActivator.class);
-    private List<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>();
+    private List<ServiceRegistration<?>> registrations = new ArrayList<>();
     private ProviderContext providerContext;
     private ServiceTracker NetworkingProviderManagerTracker;
 
index 717473e83abd486739319eac804ac7c8cebc5f55..dbe50a862b8cf0baff1e0598c073705f1d633e66 100644 (file)
@@ -61,7 +61,7 @@ public class Arp extends Packet {
 
     public Arp() {
         payload = null;
-        hdrFieldsMap = new HashMap<String, byte[]>(ARP_FIELDS_COUNT);
+        hdrFieldsMap = new HashMap<>(ARP_FIELDS_COUNT);
         setHardwareLength((short) 6); // MAC address length
         setProtocolLength((short) 4); // IPv4 address length
         setHardwareType(ETHERNET_HW_TYPE);
index a730f5f82266ed4de3a5ee7c847f99fce06d3fe6..996b512b5a90e436f08337f1e632e9085bc80f44 100644 (file)
@@ -74,8 +74,8 @@ public class EgressAclServiceTest {
     private Neutron_IPs neutron_ip_src;
     private Neutron_IPs neutron_ip_dest_1;
     private Neutron_IPs neutron_ip_dest_2;
-    private List<Neutron_IPs> neutronSrcIpList = new ArrayList<Neutron_IPs>();
-    private List<Neutron_IPs> neutronDestIpList = new ArrayList<Neutron_IPs>();
+    private List<Neutron_IPs> neutronSrcIpList = new ArrayList<>();
+    private List<Neutron_IPs> neutronDestIpList = new ArrayList<>();
     private static final String HOST_ADDRESS = "127.0.0.1/32";
     private static final String MAC_ADDRESS = "87:1D:5E:02:40:B7";
     private static final String SRC_IP = "192.168.0.1";
@@ -119,7 +119,7 @@ public class EgressAclServiceTest {
         when(portSecurityRule.getSecurityRuleEthertype()).thenReturn("IPv4");
         when(portSecurityRule.getSecurityRuleDirection()).thenReturn("egress");
 
-        List<NeutronSecurityRule> portSecurityList = new ArrayList<NeutronSecurityRule>();
+        List<NeutronSecurityRule> portSecurityList = new ArrayList<>();
         portSecurityList.add(portSecurityRule);
 
         neutron_ip_src = new Neutron_IPs();
index 50908c3fad464ba8a52b985e2202d8a677a52245..6471af9dba5170755277777f4d56ac738b9caf3f 100644 (file)
@@ -71,8 +71,8 @@ public class IngressAclServiceTest {
     @Mock private NeutronSecurityRule portSecurityRule;
     @Mock private SecurityServicesManager securityServices;
 
-    private List<Neutron_IPs> neutronSrcIpList = new ArrayList<Neutron_IPs>();
-    private List<Neutron_IPs> neutronDestIpList = new ArrayList<Neutron_IPs>();
+    private List<Neutron_IPs> neutronSrcIpList = new ArrayList<>();
+    private List<Neutron_IPs> neutronDestIpList = new ArrayList<>();
     private Neutron_IPs neutron_ip_src;
     private Neutron_IPs neutron_ip_dest_1;
     private Neutron_IPs neutron_ip_dest_2;
@@ -119,7 +119,7 @@ public class IngressAclServiceTest {
         when(portSecurityRule.getSecurityRuleEthertype()).thenReturn("IPv4");
         when(portSecurityRule.getSecurityRuleDirection()).thenReturn("ingress");
 
-        List<NeutronSecurityRule> portSecurityList = new ArrayList<NeutronSecurityRule>();
+        List<NeutronSecurityRule> portSecurityList = new ArrayList<>();
         portSecurityList.add(portSecurityRule);
 
         neutron_ip_src = new Neutron_IPs();
index 6e163c5355b703f86a398d9ead3dc5bac9b4bb0b..104c74e0dcc81ebe760857a530b253af7583c332 100644 (file)
@@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory;
 
 public class ConfigActivator implements BundleActivator {
     private static final Logger LOG = LoggerFactory.getLogger(ConfigActivator.class);
-    private List<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>();
+    private List<ServiceRegistration<?>> registrations = new ArrayList<>();
     private ProviderContext providerContext;
     private ServiceTracker iNeutronNetworkCRUDTracker;
     private ServiceTracker iNeutronPortCRUDTracker;
index e3291fba92a8dc41eee96c9dd124c1a4ac337b1f..281fb36e418b590ce76c1e55179a7362cc8e1c25 100755 (executable)
@@ -82,7 +82,7 @@ public class NeutronCacheUtils {
         List<NeutronNetwork> allNetworks = neutronNetworkCache.getAllNetworks();
         for (NeutronNetwork network: allNetworks) {
             if (network.getID().equals(networkID)) {
-                Map.Entry<String,String> entry = new AbstractMap.SimpleEntry<String, String>(
+                Map.Entry<String,String> entry = new AbstractMap.SimpleEntry<>(
                         network.getProviderNetworkType(), network.getProviderSegmentationID());
                 return entry;
             }
index afa88fb541b2732c671dbebaf66f8586407d4f24..1d9aa8c2a98709f921eaf18c44f1e6559823532e 100644 (file)
@@ -69,7 +69,7 @@ public class SecurityServicesImpl implements ConfigInterface, SecurityServicesMa
     @Override
     public List<NeutronSecurityGroup> getSecurityGroupInPortList(OvsdbTerminationPointAugmentation
                                                              terminationPointAugmentation) {
-        List<NeutronSecurityGroup> neutronSecurityGroups = new ArrayList<NeutronSecurityGroup>();
+        List<NeutronSecurityGroup> neutronSecurityGroups = new ArrayList<>();
         if (neutronPortCache == null) {
             LOG.error("neutron port is null");
             return neutronSecurityGroups;
@@ -291,7 +291,7 @@ public class SecurityServicesImpl implements ConfigInterface, SecurityServicesMa
 
     @Override
     public List<Neutron_IPs> getVmListForSecurityGroup(List<Neutron_IPs> srcAddressList, String securityGroupUuid) {
-        List<Neutron_IPs> vmListForSecurityGroup = new ArrayList<Neutron_IPs>();
+        List<Neutron_IPs> vmListForSecurityGroup = new ArrayList<>();
         /*For every port check whether security grouplist contains the current
          * security group.*/
         try {
index 4200448a6a05b8121ae8f0128d4a29c521ac948e..7cafd676ce7098684ca7a5648cb277fd01c3881d 100644 (file)
@@ -290,7 +290,7 @@ public class SouthboundImpl implements Southbound {
     }
 
     private List<ProtocolEntry> createMdsalProtocols() {
-        List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
+        List<ProtocolEntry> protocolList = new ArrayList<>();
         ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
                 MdsalHelper.OVSDB_PROTOCOL_MAP.inverse();
         protocolList.add(new ProtocolEntryBuilder().
@@ -357,7 +357,7 @@ public class SouthboundImpl implements Southbound {
     }
 
     public List<Node> getAllBridgesOnOvsdbNode(Node node) {
-        List<Node> nodes = new ArrayList<Node>();
+        List<Node> nodes = new ArrayList<>();
         List<ManagedNodeEntry> managedNodes = node.getAugmentation(OvsdbNodeAugmentation.class).getManagedNodeEntry();
         for (ManagedNodeEntry managedNode : managedNodes) {
             InstanceIdentifier<?> bridgeIid = managedNode.getBridgeRef().getValue();
@@ -450,7 +450,7 @@ public class SouthboundImpl implements Southbound {
     }
 
     public List<TerminationPoint> extractTerminationPoints(Node node) {
-        List<TerminationPoint> terminationPoints = new ArrayList<TerminationPoint>();
+        List<TerminationPoint> terminationPoints = new ArrayList<>();
         OvsdbBridgeAugmentation ovsdbBridgeAugmentation = node.getAugmentation(OvsdbBridgeAugmentation.class);
         if (ovsdbBridgeAugmentation != null) {
             terminationPoints.addAll(node.getTerminationPoint());
@@ -459,7 +459,7 @@ public class SouthboundImpl implements Southbound {
     }
 
     public List<OvsdbTerminationPointAugmentation> extractTerminationPointAugmentations( Node node ) {
-        List<OvsdbTerminationPointAugmentation> tpAugmentations = new ArrayList<OvsdbTerminationPointAugmentation>();
+        List<OvsdbTerminationPointAugmentation> tpAugmentations = new ArrayList<>();
         List<TerminationPoint> terminationPoints = node.getTerminationPoint();
         if(terminationPoints != null && !terminationPoints.isEmpty()){
             for(TerminationPoint tp : terminationPoints){
@@ -479,7 +479,7 @@ public class SouthboundImpl implements Southbound {
         if(operNode != null){
             return extractTerminationPointAugmentations(operNode);
         }
-        return new ArrayList<OvsdbTerminationPointAugmentation>();
+        return new ArrayList<>();
     }
 
     public String getInterfaceExternalIdsValue(
@@ -530,7 +530,7 @@ public class SouthboundImpl implements Southbound {
             tpAugmentationBuilder.setInterfaceType(MdsalHelper.OVSDB_INTERFACE_TYPE_MAP.get(type));
         }
 
-        List<Options> optionsList = new ArrayList<Options>();
+        List<Options> optionsList = new ArrayList<>();
         for (Map.Entry<String, String> entry : options.entrySet()) {
             OptionsBuilder optionsBuilder = new OptionsBuilder();
             optionsBuilder.setKey(new OptionsKey(entry.getKey()));
@@ -563,7 +563,7 @@ public class SouthboundImpl implements Southbound {
     }
 
     public Boolean addPatchTerminationPoint(Node node, String bridgeName, String portName, String peerPortName) {
-        Map<String, String> option = new HashMap<String, String>();
+        Map<String, String> option = new HashMap<>();
         option.put("peer", peerPortName);
         return addTerminationPoint(node, bridgeName, portName, PATCH_PORT_TYPE, option);
     }
index 47d0dbe36faea0924d574f265eeffb4ac54e8c51..915c73c25bbe97844e6bbb3f15436fd12dedfccd 100644 (file)
@@ -72,7 +72,7 @@ public class LBaaSPoolHandlerTest {
     public void setUp() {
         when(neutronLBPool.getLoadBalancerPoolProtocol()).thenReturn(LoadBalancerConfiguration.PROTOCOL_HTTP);
 
-        List<NeutronLoadBalancerPoolMember> members = new ArrayList<NeutronLoadBalancerPoolMember>();
+        List<NeutronLoadBalancerPoolMember> members = new ArrayList<>();
         NeutronLoadBalancerPoolMember neutronLBPoolMember = mock(NeutronLoadBalancerPoolMember.class);
         when(neutronLBPoolMember.getPoolMemberAdminStateIsUp()).thenReturn(true);
         when(neutronLBPoolMember.getPoolMemberSubnetID()).thenReturn("subnetID");
@@ -82,7 +82,7 @@ public class LBaaSPoolHandlerTest {
         members.add(neutronLBPoolMember);
         when(neutronLBPool.getLoadBalancerPoolMembers()).thenReturn(members);
 
-        List<NeutronLoadBalancer> list_neutronLB = new ArrayList<NeutronLoadBalancer>();
+        List<NeutronLoadBalancer> list_neutronLB = new ArrayList<>();
         NeutronLoadBalancer neutronLB = mock(NeutronLoadBalancer.class);
         when(neutronLB.getLoadBalancerName()).thenReturn("load_balancer_name");
         when(neutronLB.getLoadBalancerVipAddress()).thenReturn("vip_address");
@@ -146,7 +146,7 @@ public class LBaaSPoolHandlerTest {
         NorthboundEvent ev = mock(NorthboundEvent.class);
         when(ev.getLoadBalancerPool()).thenReturn(neutronLBPool);
 
-        List<Node> list_node = new ArrayList<Node>();
+        List<Node> list_node = new ArrayList<>();
         list_node .add(mock(Node.class));
         when(nodeCacheManager.getBridgeNodes()).thenReturn(list_node);
 
index 61a507607a517293afec91e3ae4d7a4e065c9cb6..d39bfb2cc9bb1fa25ec6ae04f6b4b1fe2d21663a 100644 (file)
@@ -85,7 +85,7 @@ public class LBaaSPoolMemberHandlerTest {
         when(NeutronCacheUtils.getMacAddress(any(INeutronPortCRUD.class), anyString(), anyString())).thenReturn("mac_address");
         when(NeutronCacheUtils.getProviderInformation(any(INeutronNetworkCRUD.class), any(INeutronSubnetCRUD.class), anyString())).thenReturn(providerInfo);
 
-        List<NeutronLoadBalancerPoolMember> members = new ArrayList<NeutronLoadBalancerPoolMember>();
+        List<NeutronLoadBalancerPoolMember> members = new ArrayList<>();
         NeutronLoadBalancerPoolMember neutronLBPoolMember = mock(NeutronLoadBalancerPoolMember.class);
         when(neutronLBPoolMember.getPoolMemberAdminStateIsUp()).thenReturn(true);
         when(neutronLBPoolMember.getPoolMemberSubnetID()).thenReturn("subnetID");
@@ -98,7 +98,7 @@ public class LBaaSPoolMemberHandlerTest {
         when(neutronLBPool.getLoadBalancerPoolMembers()).thenReturn(members);
         when(neutronLBPoolCache.getNeutronLoadBalancerPool(anyString())).thenReturn(neutronLBPool);
 
-        List<NeutronLoadBalancer> list_neutronLB = new ArrayList<NeutronLoadBalancer>();
+        List<NeutronLoadBalancer> list_neutronLB = new ArrayList<>();
         NeutronLoadBalancer neutronLB = mock(NeutronLoadBalancer.class);
         when(neutronLB.getLoadBalancerName()).thenReturn("load_balancer_name");
         when(neutronLB.getLoadBalancerVipAddress()).thenReturn("vip_address");
@@ -169,7 +169,7 @@ public class LBaaSPoolMemberHandlerTest {
         NorthboundEvent ev = mock(NorthboundEvent.class);
         when(ev.getLoadBalancerPoolMember()).thenReturn(neutronLBMember);
 
-        List<Node> list_node = new ArrayList<Node>();
+        List<Node> list_node = new ArrayList<>();
         list_node .add(mock(Node.class));
         when(nodeCacheManager.getBridgeNodes()).thenReturn(list_node);
 
index 87a8c69243bba1a235f2350f1ff5372217581868..b35df7257d04ef5c2eee701067b7cc7b0c6816a3 100644 (file)
@@ -44,11 +44,11 @@ public class NeutronCacheUtilsTest {
         Neutron_IPs ip = mock(Neutron_IPs.class);
         when(ip.getIpAddress()).thenReturn("ip_address");
         when(ip.getSubnetUUID()).thenReturn("subnetUUID");
-        List<Neutron_IPs> list_fixedIP = new ArrayList<Neutron_IPs>();
+        List<Neutron_IPs> list_fixedIP = new ArrayList<>();
         list_fixedIP.add(ip);
         when(port.getFixedIPs()).thenReturn(list_fixedIP);
         when(port.getMacAddress()).thenReturn("mac_address");
-        List<NeutronPort> list_port = new ArrayList<NeutronPort>();
+        List<NeutronPort> list_port = new ArrayList<>();
         list_port.add(port);
 
         when(neutronPortsCache.getAllPorts()).thenReturn(list_port);
@@ -65,7 +65,7 @@ public class NeutronCacheUtilsTest {
         NeutronSubnet subnet = mock(NeutronSubnet.class);
         when(subnet.getID()).thenReturn("subnetUUID");
         when(subnet.getNetworkUUID()).thenReturn("networkUUID");
-        List<NeutronSubnet> list_subnet = new ArrayList<NeutronSubnet>();
+        List<NeutronSubnet> list_subnet = new ArrayList<>();
         list_subnet.add(subnet);
 
         when(neutronSubnetCache.getAllSubnets()).thenReturn(list_subnet );
@@ -75,12 +75,12 @@ public class NeutronCacheUtilsTest {
         when(network.getID()).thenReturn("networkUUID");
         when(network.getProviderNetworkType()).thenReturn("network_type_1");
         when(network.getProviderSegmentationID()).thenReturn("network_segID");
-        List<NeutronNetwork> list_network = new ArrayList<NeutronNetwork>();
+        List<NeutronNetwork> list_network = new ArrayList<>();
         list_network.add(network);
 
         when(neutronNetworkCache.getAllNetworks()).thenReturn(list_network);
 
-        Map.Entry<String,String> entry = new AbstractMap.SimpleEntry<String, String>(
+        Map.Entry<String,String> entry = new AbstractMap.SimpleEntry<>(
                 network.getProviderNetworkType(), network.getProviderSegmentationID());
 
         assertEquals("Error, getProviderInformation() did not return the correct values", entry, NeutronCacheUtils.getProviderInformation(neutronNetworkCache, neutronSubnetCache, "subnetUUID"));
index db98417f9a2324e7bd8a47119b511f3a2471db30..2e92678a01905fd9eb0031a5978119bf016b0894 100644 (file)
@@ -90,11 +90,11 @@ public class PortHandlerTest {
         portHandlerSpy.processEvent(ev);
         verify(neutronL3Adapter, times(1)).handleNeutronPortEvent(neutronPort, Action.UPDATE);
 
-        List<Node> nodes = new ArrayList<Node>();
+        List<Node> nodes = new ArrayList<>();
         nodes.add(mock(Node.class));
         when(nodeCacheManager.getNodes()).thenReturn(nodes);
 
-        List<OvsdbTerminationPointAugmentation> ports = new ArrayList<OvsdbTerminationPointAugmentation>();
+        List<OvsdbTerminationPointAugmentation> ports = new ArrayList<>();
         OvsdbTerminationPointAugmentation port = mock(OvsdbTerminationPointAugmentation.class);
         ports.add(port);
         when(southbound.getTerminationPointsOfBridge(any(Node.class))).thenReturn(ports);
index c80df8e5f9cc44f5630793189d48ba1fb2d3d35c..97b6dc6ca324cbfd33e0dce3d9b654161dddbcdb 100644 (file)
@@ -82,7 +82,7 @@ public class SouthboundHandlerTest {
         Node node = mock(Node.class);
         when(node.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(mock(OvsdbNodeAugmentation.class));
 
-        List<Node> nodes = new ArrayList<Node>();
+        List<Node> nodes = new ArrayList<>();
         nodes.add(mock(Node.class));
         when(southbound.readOvsdbTopologyNodes()).thenReturn(nodes);
 
@@ -220,7 +220,7 @@ public class SouthboundHandlerTest {
         when(ev.getType()).thenReturn(Type.OPENVSWITCH);
 
         when(ovsdbTerminationPointAugmentation.getName()).thenReturn("network");
-        List<TerminationPoint> terminationPoints = new ArrayList<TerminationPoint>();
+        List<TerminationPoint> terminationPoints = new ArrayList<>();
         terminationPoints.add(mock(TerminationPoint.class));
         when(southbound.extractTerminationPoints(any(Node.class))).thenReturn(terminationPoints);
 
index 661584b33af15570b59d7983f52bfa4daed69cf5..0b573e5120eb942389fcbfa86872f19fcaeaea0e 100644 (file)
@@ -135,11 +135,11 @@ public class NeutronL3AdapterTest {
 
     @Test
     public void testHandleNeutronPortEvent() throws Exception {
-        Map<String, NeutronRouter_Interface> subnetIdToRouterInterfaceCache = new HashMap<String, NeutronRouter_Interface>();
+        Map<String, NeutronRouter_Interface> subnetIdToRouterInterfaceCache = new HashMap<>();
         // Mock variables
         Neutron_IPs neutronIP = mock(Neutron_IPs.class);
         when(neutronIP.getSubnetUUID()).thenReturn(UUID);
-        List<Neutron_IPs> list_neutronIP = new ArrayList<Neutron_IPs>();
+        List<Neutron_IPs> list_neutronIP = new ArrayList<>();
         list_neutronIP.add(neutronIP);
         NeutronPort neutronPort = mock(NeutronPort.class);
         when(neutronPort.getDeviceOwner()).thenReturn(OWNER_ROUTER_INTERFACE);
@@ -182,7 +182,7 @@ public class NeutronL3AdapterTest {
         Neutron_IPs neutronIP = mock(Neutron_IPs.class);
         when(neutronIP.getSubnetUUID()).thenReturn(UUID);
         NeutronPort neutronPort = mock(NeutronPort.class);
-        List<Neutron_IPs> list_neutronIP = new ArrayList<Neutron_IPs>();
+        List<Neutron_IPs> list_neutronIP = new ArrayList<>();
         list_neutronIP.add(neutronIP);
         when(neutronPort.getFixedIPs()).thenReturn(list_neutronIP);
         List<NeutronPort> list_neutronPort = new ArrayList<>();
@@ -304,8 +304,8 @@ public class NeutronL3AdapterTest {
     @SuppressWarnings({ "unchecked", "rawtypes" })
     @Test
     public void testProgramFlowsForFloatingIPArpAdd() throws Exception {
-        Map<String, Pair> neutronPortToDpIdCache = new HashMap<String, Pair>();
-        Map<String, String> networkIdToRouterMacCache = new HashMap<String, String>();
+        Map<String, Pair> neutronPortToDpIdCache = new HashMap<>();
+        Map<String, String> networkIdToRouterMacCache = new HashMap<>();
         Map floatIpDataMapCache = new HashMap();
 
         NeutronFloatingIP neutronFloatingIP = mock(NeutronFloatingIP.class);
@@ -380,7 +380,7 @@ public class NeutronL3AdapterTest {
         ConfigurationService configurationService = mock(ConfigurationService.class);
         when(configurationService.getPatchPortName(any(Pair.class))).thenReturn(PORT_INT);
         MemberModifier.field(NeutronL3Adapter.class, "configurationService").set(neutronL3Adapter , configurationService);
-        List<Node> nodes = new ArrayList<Node>();
+        List<Node> nodes = new ArrayList<>();
         nodes.add(mock(Node.class));
         NodeCacheManager nodeCacheManager = mock(NodeCacheManager.class);
         when(nodeCacheManager.getBridgeNodes()).thenReturn(nodes);
@@ -403,7 +403,7 @@ public class NeutronL3AdapterTest {
 
     @Test
     public void testHandleInterfaceEvent() throws Exception {
-        Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<String, Pair<Long,Uuid>>();
+        Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<>();
         // init instance variables
         TenantNetworkManager tenantNetworkManager = mock(TenantNetworkManager.class);
         MemberModifier.field(NeutronL3Adapter.class, "tenantNetworkManager").set(neutronL3Adapter , tenantNetworkManager);
@@ -444,7 +444,7 @@ public class NeutronL3AdapterTest {
 
     @Test
     public void testHandleInterfaceEventAdd() throws Exception {
-        Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<String, Pair<Long,Uuid>>();
+        Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<>();
         // init instance variables
         MemberModifier.field(NeutronL3Adapter.class, "neutronPortToDpIdCache").set(neutronL3Adapter , neutronPortToDpIdCache);
         int temp = neutronPortToDpIdCache.size();
@@ -457,7 +457,7 @@ public class NeutronL3AdapterTest {
     @SuppressWarnings("unchecked")
     @Test
     public void testHandleInterfaceEventDelete() throws Exception {
-        Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<String, Pair<Long,Uuid>>();
+        Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<>();
         OvsdbTerminationPointAugmentation intf = mock(OvsdbTerminationPointAugmentation.class);
         Uuid uuid = mock(Uuid.class);
         when(intf.getInterfaceUuid()).thenReturn(uuid );
@@ -476,11 +476,11 @@ public class NeutronL3AdapterTest {
 
     @Test
     public void testUpdateL3ForNeutronPort() throws Exception {
-        Map<String, String> networkIdToRouterMacCache = new HashMap<String, String>();
+        Map<String, String> networkIdToRouterMacCache = new HashMap<>();
 
         Neutron_IPs neutronIp = mock(Neutron_IPs.class);
         when(neutronIp.getIpAddress()).thenReturn(FIXED_IP_ADDRESS);
-        List<Neutron_IPs> neutronIps = new ArrayList<Neutron_IPs>();
+        List<Neutron_IPs> neutronIps = new ArrayList<>();
         neutronIps.add(neutronIp);
         NeutronPort neutronPort = mock(NeutronPort.class);
         when(neutronPort.getNetworkUUID()).thenReturn(UUID);
@@ -488,7 +488,7 @@ public class NeutronL3AdapterTest {
         when(neutronPort.getFixedIPs()).thenReturn(neutronIps);
         NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
         when(neutronNetwork.getProviderSegmentationID()).thenReturn(ID);
-        List<Node> nodes = new ArrayList<Node>();
+        List<Node> nodes = new ArrayList<>();
         nodes.add(mock(Node.class));
         PowerMockito.doReturn(Long.valueOf(15)).when(neutronL3Adapter, "getDpidForIntegrationBridge", any(Node.class));
 
@@ -521,7 +521,7 @@ public class NeutronL3AdapterTest {
     // either add or remove item in l3ForwardingCache
     @Test
     public void testProgramL3ForwardingStage1() throws Exception {
-        Set<String> l3ForwardingCache = new HashSet<String>();
+        Set<String> l3ForwardingCache = new HashSet<>();
 
         NodeId nodeId = mock(NodeId.class);
         when(nodeId.getValue()).thenReturn(ID);
@@ -568,16 +568,16 @@ public class NeutronL3AdapterTest {
 
     @Test
     public void testProgramFlowsForNeutronRouterInterface() throws Exception {
-        Map<String, String> networkIdToRouterMacCache = new HashMap<String, String>();
-        Map<String, List<Neutron_IPs>> networkIdToRouterIpListCache = new HashMap<String, List<Neutron_IPs>>();
-        Map<String, NeutronRouter_Interface> subnetIdToRouterInterfaceCache = new HashMap<String, NeutronRouter_Interface>();
+        Map<String, String> networkIdToRouterMacCache = new HashMap<>();
+        Map<String, List<Neutron_IPs>> networkIdToRouterIpListCache = new HashMap<>();
+        Map<String, NeutronRouter_Interface> subnetIdToRouterInterfaceCache = new HashMap<>();
 
         NeutronRouter_Interface intf = mock(NeutronRouter_Interface.class);
         when(intf.getPortUUID()).thenReturn(UUID);
         when(intf.getSubnetUUID()).thenReturn(UUID);
         Neutron_IPs neutronIp = mock(Neutron_IPs.class);
         when(neutronIp.getIpAddress()).thenReturn(FIXED_IP_ADDRESS);
-        List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
+        List<Neutron_IPs> ips = new ArrayList<>();
         ips.add(neutronIp);
         NeutronPort neutronPort = mock(NeutronPort.class);
         when(neutronPort.getMacAddress()).thenReturn(MAC_ADDRESS);
@@ -594,7 +594,7 @@ public class NeutronL3AdapterTest {
         NeutronRouter neutronRouter = mock(NeutronRouter.class);
 
         Node node = mock(Node.class);
-        List<Node> nodes = new ArrayList<Node>();
+        List<Node> nodes = new ArrayList<>();
         nodes.add(node);
 
         MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "getDpidForIntegrationBridge", Node.class));
@@ -679,7 +679,7 @@ public class NeutronL3AdapterTest {
         when(neutronNetwork.getProviderSegmentationID()).thenReturn(ID);
         Neutron_IPs ip = mock(Neutron_IPs.class);
         when(ip.getIpAddress()).thenReturn(IP);
-        List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
+        List<Neutron_IPs> ips = new ArrayList<>();
         ips.add(ip);
         ips.add(ip);
         ips.add(ip);
@@ -714,7 +714,7 @@ public class NeutronL3AdapterTest {
 
     @Test
     public void testProgramRouterInterfaceStage1() throws Exception {
-        Set<String> routerInterfacesCache = new HashSet<String>();
+        Set<String> routerInterfacesCache = new HashSet<>();
 
         NodeId nodeId = mock(NodeId.class);
         when(nodeId.getValue()).thenReturn(ID);
@@ -761,7 +761,7 @@ public class NeutronL3AdapterTest {
     //either add or remove staticArpEntryCache
     @Test
     public void testProgramStaticArpStage1() throws Exception {
-        Set<String> staticArpEntryCache = new HashSet<String>();
+        Set<String> staticArpEntryCache = new HashSet<>();
 
         MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "programStaticArpStage2", Long.class, String.class, String.class, String.class, Action.class));
 
@@ -796,7 +796,7 @@ public class NeutronL3AdapterTest {
     // either add or remove inboundIpRewriteCache
     @Test
     public void testProgramInboundIpRewriteStage1() throws Exception {
-        Set<String> inboundIpRewriteCache = new HashSet<String>();
+        Set<String> inboundIpRewriteCache = new HashSet<>();
 
         MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "programInboundIpRewriteStage2", Long.class, Long.class, String.class, String.class, String.class, Action.class));
 
@@ -831,7 +831,7 @@ public class NeutronL3AdapterTest {
     // either add or remove outboundIpRewriteExclusionCache
     @Test
     public void testProgramIpRewriteExclusionStage1() throws Exception {
-        Set<String> outboundIpRewriteExclusionCache = new HashSet<String>();
+        Set<String> outboundIpRewriteExclusionCache = new HashSet<>();
 
         NodeId nodeId = mock(NodeId.class);
         when(nodeId.getValue()).thenReturn(ID);
@@ -871,7 +871,7 @@ public class NeutronL3AdapterTest {
     @SuppressWarnings("unchecked")
     @Test
     public void testProgramOutboundIpRewriteStage1() throws Exception{
-        HashSet<String> outboundIpRewriteCache = new HashSet<String>();
+        Set<String> outboundIpRewriteCache = new HashSet<>();
 
         MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "programOutboundIpRewriteStage2", floatingIpClass, Action.class));
 
index d7a2e3117705875d24b6209cc49f956f8591f52f..30b0286bbb2dcf6eb8cfa7c3549257861ca791a6 100644 (file)
@@ -56,7 +56,7 @@ public class SecurityServicesImplTest {
     public void setUp(){
         NeutronPort neutronPort = mock(NeutronPort.class);
 
-        List<NeutronSecurityGroup> securityGroups = new ArrayList<NeutronSecurityGroup>();
+        List<NeutronSecurityGroup> securityGroups = new ArrayList<>();
         securityGroups.add(neutronSecurityGroup);
 
         when(neutronPort.getSecurityGroups()).thenReturn(securityGroups);
index 05bc17c8b0aa0948ab02bda22ba7c8c8c714cd3c..b3950fdc9b246fb9cd89e719710bff9519f771b8 100644 (file)
@@ -106,7 +106,7 @@ public class TenantNetworkManagerImplTest {
         NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
         when(neutronNetwork.getProviderSegmentationID()).thenReturn(SEG_ID);
         when(neutronNetwork.getNetworkUUID()).thenReturn(NETWORK_ID);
-        ArrayList<NeutronNetwork> listNeutronNetwork = new ArrayList<NeutronNetwork>();
+        List<NeutronNetwork> listNeutronNetwork = new ArrayList<>();
         listNeutronNetwork.add(neutronNetwork);
         when(neutronNetworkCache.getAllNetworks()).thenReturn(listNeutronNetwork);
 
@@ -115,7 +115,7 @@ public class TenantNetworkManagerImplTest {
         when(neutronPort.getNetworkUUID()).thenReturn(NETWORK_ID);
         when(neutronPortCache.getPort(anyString())).thenReturn(neutronPort);
 
-        List<OvsdbTerminationPointAugmentation> ports = new ArrayList<OvsdbTerminationPointAugmentation>();
+        List<OvsdbTerminationPointAugmentation> ports = new ArrayList<>();
         ports.add(mock(OvsdbTerminationPointAugmentation.class));
         when(southbound.getTerminationPointsOfBridge(any(Node.class))).thenReturn(ports);
 
@@ -128,7 +128,7 @@ public class TenantNetworkManagerImplTest {
     @Test
     public void testGetNetworkId() {
         NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
-        ArrayList<NeutronNetwork> listNeutronNetwork = new ArrayList<NeutronNetwork>();
+        List<NeutronNetwork> listNeutronNetwork = new ArrayList<>();
         listNeutronNetwork.add(neutronNetwork);
 
         when(neutronNetwork.getProviderSegmentationID()).thenReturn("segId");
index 7d23ebe9d3a7cca593614bc2deda36cdd48129c0..f807e2199429ac143ca7c3defdb2aef17fbd2b5d 100644 (file)
@@ -55,7 +55,7 @@ public class VlanConfigurationCacheImplTest {
     @Before
     public void setUp(){
         when(southbound.getOvsdbNodeUUID(any(Node.class))).thenReturn(NODE_UUID);
-        List<OvsdbTerminationPointAugmentation> ports = new ArrayList<OvsdbTerminationPointAugmentation>();
+        List<OvsdbTerminationPointAugmentation> ports = new ArrayList<>();
         OvsdbTerminationPointAugmentation port = mock(OvsdbTerminationPointAugmentation.class);
         VlanId vlanId = mock(VlanId.class);
         when(vlanId.getValue()).thenReturn(VLAN_ID);