From 290cbb1e6f60cbedb90aaf94fbd58d25a87a6a18 Mon Sep 17 00:00:00 2001 From: matthieu Date: Thu, 1 Jun 2017 16:16:13 -0400 Subject: [PATCH] Code Clean up: remove type from <> Since Java 7 is not necessary to explicit type from <> Change-Id: Iccec01a57a0bd6d0bc19cebca153fabfa825c9ca Signed-off-by: matthieu --- .../neutron/spi/NeutronL2gateway.java | 2 +- .../opendaylight/neutron/spi/NeutronPort.java | 12 +++++----- .../neutron/spi/NeutronSFCFlowClassifier.java | 2 +- .../neutron/spi/NeutronSFCPortPair.java | 2 +- .../neutron/spi/NeutronSubnet.java | 12 +++++----- .../neutron/spi/JaxbTestHelper.java | 4 ++-- ...tronLoadBalancerHealthMonitorJAXBTest.java | 2 +- .../neutron/spi/NeutronSubnetTest.java | 8 +++---- .../api/NeutronNorthboundRSApplication.java | 6 ++--- .../api/PaginatedRequestFactory.java | 2 +- .../transcriber/AbstractNeutronInterface.java | 4 ++-- .../transcriber/NeutronBgpvpnInterface.java | 24 +++++++++---------- .../NeutronL2gatewayInterface.java | 9 ++++--- ...ronLoadBalancerHealthMonitorInterface.java | 4 ++-- .../NeutronLoadBalancerListenerInterface.java | 4 ++-- .../NeutronLoadBalancerPoolInterface.java | 11 ++++----- .../transcriber/NeutronNetworkInterface.java | 2 +- .../transcriber/NeutronPortInterface.java | 12 +++++----- .../transcriber/NeutronRouterInterface.java | 7 +++--- .../transcriber/NeutronSubnetInterface.java | 8 +++---- ...utronVpnIpSecSiteConnectionsInterface.java | 4 ++-- 21 files changed, 69 insertions(+), 72 deletions(-) diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gateway.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gateway.java index c672c0a3b..8b083894c 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gateway.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronL2gateway.java @@ -34,7 +34,7 @@ public final class NeutronL2gateway extends NeutronBaseAttributes devices = new ArrayList(); + List devices = new ArrayList<>(); devices.addAll(this.getNeutronL2gatewayDevices()); ans.setNeutronL2gatewayDevices(devices); break; diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronPort.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronPort.java index b36cbf569..f6abaafc1 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronPort.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronPort.java @@ -210,7 +210,7 @@ public final class NeutronPort extends NeutronAdminAttributes imple ans.setMacAddress(this.getMacAddress()); break; case "fixed_ips": - ans.setFixedIps(new ArrayList(this.getFixedIps())); + ans.setFixedIps(new ArrayList<>(this.getFixedIps())); break; case "device_id": ans.setDeviceID(this.getDeviceID()); @@ -219,11 +219,11 @@ public final class NeutronPort extends NeutronAdminAttributes imple ans.setDeviceOwner(this.getDeviceOwner()); break; case "security_groups": - ans.setSecurityGroups(new ArrayList(this.getSecurityGroups())); + ans.setSecurityGroups(new ArrayList<>(this.getSecurityGroups())); break; case "allowed_address_pairs": ans.setAllowedAddressPairs( - new ArrayList(this.getAllowedAddressPairs())); + new ArrayList<>(this.getAllowedAddressPairs())); break; case "binding:host_id": ans.setBindinghostID(this.getBindinghostID()); @@ -235,10 +235,10 @@ public final class NeutronPort extends NeutronAdminAttributes imple ans.setBindingvifType(this.getBindingvifType()); break; case "binding:vif_details": - ans.setVIFDetails(new HashMap(this.getVIFDetails())); + ans.setVIFDetails(new HashMap<>(this.getVIFDetails())); break; case "extra_dhcp_opts": - ans.setExtraDHCPOptions(new ArrayList(this.getExtraDHCPOptions())); + ans.setExtraDHCPOptions(new ArrayList<>(this.getExtraDHCPOptions())); break; case "port_security_enabled": ans.setPortSecurityEnabled(this.getPortSecurityEnabled()); @@ -259,7 +259,7 @@ public final class NeutronPort extends NeutronAdminAttributes imple portSecurityEnabled = true; } if (fixedIps == null) { - fixedIps = new ArrayList(); + fixedIps = new ArrayList<>(); } } diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCFlowClassifier.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCFlowClassifier.java index afe21fcc2..066adf342 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCFlowClassifier.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCFlowClassifier.java @@ -180,7 +180,7 @@ public final class NeutronSFCFlowClassifier extends NeutronBaseAttributes(this.getL7Parameters())); + ans.setL7Parameters(new HashMap<>(this.getL7Parameters())); break; default: return super.extractField(field, ans); diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPair.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPair.java index af3130e01..da291dcba 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPair.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSFCPortPair.java @@ -70,7 +70,7 @@ public final class NeutronSFCPortPair extends NeutronBaseAttributes(this.getServiceFunctionParameters())); + ans.setServiceFunctionParameters(new HashMap<>(this.getServiceFunctionParameters())); break; default: return super.extractField(field, ans); diff --git a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java index 289e4bdfb..c5f6bf9c0 100644 --- a/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java +++ b/neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java @@ -172,17 +172,17 @@ public final class NeutronSubnet extends NeutronBaseAttributes im ans.setGatewayIp(this.getGatewayIp()); break; case "dns_nameservers": - List nsList = new ArrayList(); + List nsList = new ArrayList<>(); nsList.addAll(this.getDnsNameservers()); ans.setDnsNameservers(nsList); break; case "allocation_pools": - List pools = new ArrayList(); + List pools = new ArrayList<>(); pools.addAll(this.getAllocationPools()); ans.setAllocationPools(pools); break; case "host_routes": - List hostRoutes = new ArrayList(); + List hostRoutes = new ArrayList<>(); hostRoutes.addAll(this.getHostRoutes()); ans.setHostRoutes(hostRoutes); break; @@ -269,13 +269,13 @@ public final class NeutronSubnet extends NeutronBaseAttributes im ipVersion = IPV4_VERSION; } if (dnsNameservers == null) { - dnsNameservers = new ArrayList(); + dnsNameservers = new ArrayList<>(); } if (hostRoutes == null) { - hostRoutes = new ArrayList(); + hostRoutes = new ArrayList<>(); } if (allocationPools == null) { - allocationPools = new ArrayList(); + allocationPools = new ArrayList<>(); if (ipVersion == IPV4_VERSION) { try { SubnetUtils util = new SubnetUtils(cidr); diff --git a/neutron-spi/src/test/java/org/opendaylight/neutron/spi/JaxbTestHelper.java b/neutron-spi/src/test/java/org/opendaylight/neutron/spi/JaxbTestHelper.java index 35b5e5523..81d21145f 100644 --- a/neutron-spi/src/test/java/org/opendaylight/neutron/spi/JaxbTestHelper.java +++ b/neutron-spi/src/test/java/org/opendaylight/neutron/spi/JaxbTestHelper.java @@ -25,11 +25,11 @@ public class JaxbTestHelper { Class cls = schemaObject.getClass(); Class[] types = new Class[1]; types[0] = cls; - Map namespacePrefixMapper = new HashMap(3); + Map namespacePrefixMapper = new HashMap<>(3); namespacePrefixMapper.put("router", "router"); namespacePrefixMapper.put("provider", "provider"); namespacePrefixMapper.put("binding", "binding"); - Map jaxbProperties = new HashMap(2); + Map jaxbProperties = new HashMap<>(2); jaxbProperties.put(JAXBContextProperties.MEDIA_TYPE, "application/json"); jaxbProperties.put(JAXBContextProperties.JSON_INCLUDE_ROOT, false); jaxbProperties.put(JAXBContextProperties.JSON_NAMESPACE_SEPARATOR, ':'); diff --git a/neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronLoadBalancerHealthMonitorJAXBTest.java b/neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronLoadBalancerHealthMonitorJAXBTest.java index 2db22cc26..80f17f259 100644 --- a/neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronLoadBalancerHealthMonitorJAXBTest.java +++ b/neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronLoadBalancerHealthMonitorJAXBTest.java @@ -60,7 +60,7 @@ public class NeutronLoadBalancerHealthMonitorJAXBTest { NeutronID neutronId = new NeutronID(); neutronId.setID("2f245a7b-0000-4f26-9cf9-9e82d248fda7"); - List loadBalancerHealthMonitorPool = new ArrayList(); + List loadBalancerHealthMonitorPool = new ArrayList<>(); loadBalancerHealthMonitorPool.add(neutronId); testObject.setLoadBalancerHealthMonitorPools(loadBalancerHealthMonitorPool); Assert.assertEquals("NeutronLoadBalancerHealthMonitor JAXB Test 11: Testing Pools failed", diff --git a/neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronSubnetTest.java b/neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronSubnetTest.java index 2cdcd8271..ca3794532 100644 --- a/neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronSubnetTest.java +++ b/neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronSubnetTest.java @@ -47,7 +47,7 @@ public class NeutronSubnetTest { NeutronSubnetIpAllocationPool allocationPool = new NeutronSubnetIpAllocationPool(); allocationPool.setPoolStart("10.18.0.2"); allocationPool.setPoolEnd("10.18.0.6"); - List pools = new ArrayList(); + List pools = new ArrayList<>(); pools.add(allocationPool); objectUT.setAllocationPools(pools); @@ -69,7 +69,7 @@ public class NeutronSubnetTest { allocationPool = new NeutronSubnetIpAllocationPool(); allocationPool.setPoolStart("2015::2"); allocationPool.setPoolEnd("2015::6"); - pools = new ArrayList(); + pools = new ArrayList<>(); pools.add(allocationPool); objectUT.setAllocationPools(pools); @@ -117,7 +117,7 @@ public class NeutronSubnetTest { NeutronSubnetIpAllocationPool allocationPool = new NeutronSubnetIpAllocationPool(); allocationPool.setPoolStart("10.18.0.2"); allocationPool.setPoolEnd("10.18.0.6"); - List pools = new ArrayList(); + List pools = new ArrayList<>(); pools.add(allocationPool); allocationPool = new NeutronSubnetIpAllocationPool(); allocationPool.setPoolStart("10.18.0.10"); @@ -132,7 +132,7 @@ public class NeutronSubnetTest { allocationPool = new NeutronSubnetIpAllocationPool(); allocationPool.setPoolStart("2015::2"); allocationPool.setPoolEnd("2015::6"); - pools = new ArrayList(); + pools = new ArrayList<>(); pools.add(allocationPool); allocationPool = new NeutronSubnetIpAllocationPool(); allocationPool.setPoolStart("2015::10"); diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNorthboundRSApplication.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNorthboundRSApplication.java index d022ce725..904e982db 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNorthboundRSApplication.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNorthboundRSApplication.java @@ -26,7 +26,7 @@ public final class NeutronNorthboundRSApplication extends Application { @Override public Set> getClasses() { - Set> classes = new HashSet>(); + Set> classes = new HashSet<>(); // northbound URIs classes.add(NeutronNetworksNorthbound.class); classes.add(NeutronSubnetsNorthbound.class); @@ -72,7 +72,7 @@ public final class NeutronNorthboundRSApplication extends Application { moxyJsonProvider.setMarshalEmptyCollections(true); moxyJsonProvider.setValueWrapper("$"); - Map namespacePrefixMapper = new HashMap(HASHMAP_SIZE); + Map namespacePrefixMapper = new HashMap<>(HASHMAP_SIZE); // FIXME: fill in next two with XSD namespacePrefixMapper.put("router", "router"); namespacePrefixMapper.put("provider", "provider"); @@ -80,7 +80,7 @@ public final class NeutronNorthboundRSApplication extends Application { moxyJsonProvider.setNamespacePrefixMapper(namespacePrefixMapper); moxyJsonProvider.setNamespaceSeparator(':'); - Set set = new HashSet(1); + Set set = new HashSet<>(1); set.add(moxyJsonProvider); return set; } diff --git a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java index 3a8ea92de..84d1b478e 100644 --- a/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java +++ b/northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java @@ -155,6 +155,6 @@ public final class PaginatedRequestFactory { links.add(previous); } - return new PaginationResults(collection, links); + return new PaginationResults<>(collection, links); } } diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java index 58e7456d9..cee364351 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java @@ -389,7 +389,7 @@ public abstract class AbstractNeutronInterface getAll(ReadTransaction tx) { Preconditions.checkNotNull(tx); - final Set allNeutronObjects = new HashSet(); + final Set allNeutronObjects = new HashSet<>(); final U dataObjects = readMd(createInstanceIdentifier(), tx); if (dataObjects != null) { for (final T dataObject : getDataObjectList(dataObjects)) { @@ -397,7 +397,7 @@ public abstract class AbstractNeutronInterface ans = new ArrayList(); + final List ans = new ArrayList<>(); ans.addAll(allNeutronObjects); return ans; } diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java index fcf486363..05d26dc3e 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java @@ -57,42 +57,42 @@ public final class NeutronBgpvpnInterface extends AbstractNeutronInterface routeTargets = new ArrayList(); + final List routeTargets = new ArrayList<>(); for (final String routeTarget : bgpvpn.getRouteTargets()) { routeTargets.add(routeTarget); } result.setRouteTargets(routeTargets); } if (bgpvpn.getImportTargets() != null) { - final List importTargets = new ArrayList(); + final List importTargets = new ArrayList<>(); for (final String importTarget : bgpvpn.getImportTargets()) { importTargets.add(importTarget); } result.setImportTargets(importTargets); } if (bgpvpn.getExportTargets() != null) { - final List exportTargets = new ArrayList(); + final List exportTargets = new ArrayList<>(); for (final String exportTarget : bgpvpn.getExportTargets()) { exportTargets.add(exportTarget); } result.setExportTargets(exportTargets); } if (bgpvpn.getRouteDistinguishers() != null) { - final List routeDistinguishers = new ArrayList(); + final List routeDistinguishers = new ArrayList<>(); for (final String routeDistinguisher : bgpvpn.getRouteDistinguishers()) { routeDistinguishers.add(routeDistinguisher); } result.setRouteDistinguishers(routeDistinguishers); } if (bgpvpn.getRouters() != null) { - final List routers = new ArrayList(); + final List routers = new ArrayList<>(); for (final Uuid router : bgpvpn.getRouters()) { routers.add(router.getValue()); } result.setRouters(routers); } if (bgpvpn.getNetworks() != null) { - final List networks = new ArrayList(); + final List networks = new ArrayList<>(); for (final Uuid network : bgpvpn.getNetworks()) { networks.add(network.getValue()); } @@ -120,42 +120,42 @@ public final class NeutronBgpvpnInterface extends AbstractNeutronInterface routeTargets = new ArrayList(); + final List routeTargets = new ArrayList<>(); for (final String routeTarget : bgpvpn.getRouteTargets()) { routeTargets.add(routeTarget); } bgpvpnBuilder.setRouteTargets(routeTargets); } if (bgpvpn.getImportTargets() != null) { - final List importTargets = new ArrayList(); + final List importTargets = new ArrayList<>(); for (final String importTarget : bgpvpn.getImportTargets()) { importTargets.add(importTarget); } bgpvpnBuilder.setImportTargets(importTargets); } if (bgpvpn.getExportTargets() != null) { - final List exportTargets = new ArrayList(); + final List exportTargets = new ArrayList<>(); for (final String exportTarget : bgpvpn.getExportTargets()) { exportTargets.add(exportTarget); } bgpvpnBuilder.setExportTargets(exportTargets); } if (bgpvpn.getRouteDistinguishers() != null) { - final List routeDistinguishers = new ArrayList(); + final List routeDistinguishers = new ArrayList<>(); for (final String routeDistinguisher : bgpvpn.getRouteDistinguishers()) { routeDistinguishers.add(routeDistinguisher); } bgpvpnBuilder.setRouteDistinguishers(routeDistinguishers); } if (bgpvpn.getRouters() != null) { - final List routers = new ArrayList(); + final List routers = new ArrayList<>(); for (final String router : bgpvpn.getRouters()) { routers.add(toUuid(router)); } bgpvpnBuilder.setRouters(routers); } if (bgpvpn.getNetworks() != null) { - final List networks = new ArrayList(); + final List networks = new ArrayList<>(); for (final String network : bgpvpn.getNetworks()) { networks.add(toUuid(network)); } diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronL2gatewayInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronL2gatewayInterface.java index 2527e6f69..fdd770677 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronL2gatewayInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronL2gatewayInterface.java @@ -39,7 +39,7 @@ public final class NeutronL2gatewayInterface @Override protected NeutronL2gateway fromMd(L2gateway l2gateway) { final NeutronL2gateway result = new NeutronL2gateway(); - final List neutronL2gatewayDevices = new ArrayList(); + final List neutronL2gatewayDevices = new ArrayList<>(); if (l2gateway.getUuid() != null) { result.setID(l2gateway.getUuid().getValue()); @@ -53,8 +53,7 @@ public final class NeutronL2gatewayInterface if (l2gateway.getDevices() != null) { for (final Devices device : l2gateway.getDevices()) { final NeutronL2gatewayDevice neutronL2gatewayDevice = new NeutronL2gatewayDevice(); - final List neutronL2gatewayDeviceInterfaces = new ArrayList< - NeutronL2gatewayDeviceInterface>(); + final List neutronL2gatewayDeviceInterfaces = new ArrayList<>(); if (device.getDeviceName() != null) { neutronL2gatewayDevice.setDeviceName(device.getDeviceName().toString()); } @@ -66,7 +65,7 @@ public final class NeutronL2gatewayInterface final NeutronL2gatewayDeviceInterface neutronL2gatewayDeviceInterface = new NeutronL2gatewayDeviceInterface(); String interfaceName = null; - final List segmentationIds = new ArrayList(); + final List segmentationIds = new ArrayList<>(); if (deviceInterface.getInterfaceName() != null) { interfaceName = deviceInterface.getInterfaceName().toString(); } @@ -109,7 +108,7 @@ public final class NeutronL2gatewayInterface for (final NeutronL2gatewayDeviceInterface neutronL2gatewayDeviceInterface : neutronL2gatewayDevice .getNeutronL2gatewayDeviceInterfaces()) { final InterfacesBuilder interfacesBuilder = new InterfacesBuilder(); - final List segmentIds = new ArrayList(); + final List segmentIds = new ArrayList<>(); interfacesBuilder.setInterfaceName(neutronL2gatewayDeviceInterface.getInterfaceName()); if (neutronL2gatewayDeviceInterface.getSegmentationId() != null) { for (final Integer segmentationId : neutronL2gatewayDeviceInterface.getSegmentationId()) { diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerHealthMonitorInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerHealthMonitorInterface.java index 0d7cced84..3cf5e236f 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerHealthMonitorInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerHealthMonitorInterface.java @@ -65,7 +65,7 @@ public final class NeutronLoadBalancerHealthMonitorInterface healthmonitorBuilder.setMaxRetries(Integer.valueOf(healthMonitor.getLoadBalancerHealthMonitorMaxRetries())); } if (healthMonitor.getLoadBalancerHealthMonitorPools() != null) { - final List listUuid = new ArrayList(); + final List listUuid = new ArrayList<>(); for (final NeutronID neutronId : healthMonitor.getLoadBalancerHealthMonitorPools()) { listUuid.add(toUuid(neutronId.getID())); } @@ -111,7 +111,7 @@ public final class NeutronLoadBalancerHealthMonitorInterface answer.setLoadBalancerHealthMonitorMaxRetries(Integer.valueOf(healthMonitor.getMaxRetries())); } if (healthMonitor.getPools() != null) { - final List list = new ArrayList(); + final List list = new ArrayList<>(); for (final Uuid id : healthMonitor.getPools()) { list.add(new NeutronID(id.getValue())); } diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerListenerInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerListenerInterface.java index 5ecb6d2e5..cdac008e2 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerListenerInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerListenerInterface.java @@ -56,7 +56,7 @@ public final class NeutronLoadBalancerListenerInterface listenerBuilder.setDefaultPoolId(toUuid(listener.getNeutronLoadBalancerListenerDefaultPoolID())); } if (listener.getNeutronLoadBalancerListenerLoadBalancerIDs() != null) { - final List listLoadBalancers = new ArrayList(); + final List listLoadBalancers = new ArrayList<>(); for (final NeutronID neutronId : listener.getNeutronLoadBalancerListenerLoadBalancerIDs()) { listLoadBalancers.add(toUuid(neutronId.getID())); } @@ -92,7 +92,7 @@ public final class NeutronLoadBalancerListenerInterface answer.setNeutronLoadBalancerListenerDefaultPoolID(listener.getDefaultPoolId().getValue()); } if (listener.getLoadbalancers() != null) { - final List list = new ArrayList(); + final List list = new ArrayList<>(); for (final Uuid id : listener.getLoadbalancers()) { list.add(new NeutronID(id.getValue())); } diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerPoolInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerPoolInterface.java index d660c05e7..9ff0cd0fc 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerPoolInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerPoolInterface.java @@ -77,7 +77,7 @@ public final class NeutronLoadBalancerPoolInterface poolBuilder.setLbAlgorithm(pool.getLoadBalancerPoolLbAlgorithm()); } if (pool.getLoadBalancerPoolListeners() != null) { - final List listListener = new ArrayList(); + final List listListener = new ArrayList<>(); for (final NeutronID neutronId : pool.getLoadBalancerPoolListeners()) { listListener.add(toUuid(neutronId.getID())); } @@ -123,14 +123,14 @@ public final class NeutronLoadBalancerPoolInterface answer.setLoadBalancerPoolLbAlgorithm(pool.getLbAlgorithm()); } if (pool.getListeners() != null) { - final List ids = new ArrayList(); + final List ids = new ArrayList<>(); for (final Uuid id : pool.getListeners()) { ids.add(new NeutronID(id.getValue())); } answer.setLoadBalancerPoolListeners(ids); } if (pool.getMembers() != null) { - final List members = new ArrayList(); + final List members = new ArrayList<>(); for (final Member member : pool.getMembers().getMember()) { members.add(fromMemberMd(member)); } @@ -176,8 +176,7 @@ public final class NeutronLoadBalancerPoolInterface } public List getAllNeutronLoadBalancerPoolMembers(String poolUuid) { - final Set allLoadBalancerPoolMembers = new HashSet< - NeutronLoadBalancerPoolMember>(); + final Set allLoadBalancerPoolMembers = new HashSet<>(); final Members members = readMd(createMembersInstanceIdentifier(toMd(poolUuid))); if (members != null) { for (final Member member : members.getMember()) { @@ -186,7 +185,7 @@ public final class NeutronLoadBalancerPoolInterface } LOGGER.debug("Exiting getLoadBalancerPoolMembers, Found {} OpenStackLoadBalancerPoolMember", allLoadBalancerPoolMembers.size()); - final List ans = new ArrayList(); + final List ans = new ArrayList<>(); ans.addAll(allLoadBalancerPoolMembers); return ans; } diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronNetworkInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronNetworkInterface.java index 226b88ed6..a9179433d 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronNetworkInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronNetworkInterface.java @@ -64,7 +64,7 @@ public final class NeutronNetworkInterface result.setProviderPhysicalNetwork(providerExtension.getPhysicalNetwork()); result.setProviderSegmentationID(providerExtension.getSegmentationId()); result.setProviderNetworkType(NETWORK_MAP.get(providerExtension.getNetworkType())); - final List segments = new ArrayList(); + final List segments = new ArrayList<>(); if (providerExtension.getSegments() != null) { for (final Segments segment : providerExtension.getSegments()) { final NeutronNetworkSegment neutronSegment = new NeutronNetworkSegment(); diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronPortInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronPortInterface.java index 86e09b5d9..bc7520735 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronPortInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronPortInterface.java @@ -97,7 +97,7 @@ public final class NeutronPortInterface extends AbstractNeutronInterface pairs = new ArrayList(); + final List pairs = new ArrayList<>(); for (final AllowedAddressPairs mdPair : port.getAllowedAddressPairs()) { final NeutronPortAllowedAddressPairs pair = new NeutronPortAllowedAddressPairs(); pair.setIpAddress(String.valueOf(mdPair.getIpAddress().getValue())); @@ -109,7 +109,7 @@ public final class NeutronPortInterface extends AbstractNeutronInterface options = new ArrayList(); + final List options = new ArrayList<>(); for (final ExtraDhcpOpts opt : port.getExtraDhcpOpts()) { final NeutronPortExtraDHCPOption arg = new NeutronPortExtraDHCPOption(); arg.setName(opt.getOptName()); @@ -120,7 +120,7 @@ public final class NeutronPortInterface extends AbstractNeutronInterface ips = new ArrayList(); + final List ips = new ArrayList<>(); for (final FixedIps mdIp : port.getFixedIps()) { final NeutronIps ip = new NeutronIps(); ip.setIpAddress(String.valueOf(mdIp.getIpAddress().getValue())); @@ -132,13 +132,13 @@ public final class NeutronPortInterface extends AbstractNeutronInterface allGroups = new HashSet(); + final Set allGroups = new HashSet<>(); for (final Uuid sgUuid : port.getSecurityGroups()) { final NeutronSecurityGroup sg = new NeutronSecurityGroup(); sg.setID(sgUuid.getValue()); allGroups.add(sg); } - final List groups = new ArrayList(); + final List groups = new ArrayList<>(); groups.addAll(allGroups); result.setSecurityGroups(groups); } @@ -236,7 +236,7 @@ public final class NeutronPortInterface extends AbstractNeutronInterface listSecurityGroups = new ArrayList(); + final List listSecurityGroups = new ArrayList<>(); for (final NeutronSecurityGroup neutronSecurityGroup : neutronPort.getSecurityGroups()) { listSecurityGroups.add(toUuid(neutronSecurityGroup.getID())); } diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronRouterInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronRouterInterface.java index 5a7aa73b3..03ede6014 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronRouterInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronRouterInterface.java @@ -64,8 +64,7 @@ public final class NeutronRouterInterface extends AbstractNeutronInterface neutronRouterNetworkReferences = new ArrayList< - NeutronRouterNetworkReference>(); + final List neutronRouterNetworkReferences = new ArrayList<>(); neutronRouterNetworkReferences.add(router.getExternalGatewayInfo()); for (final NeutronRouterNetworkReference externalGatewayInfos : neutronRouterNetworkReferences) { final ExternalGatewayInfoBuilder builder = new ExternalGatewayInfoBuilder(); @@ -96,7 +95,7 @@ public final class NeutronRouterInterface extends AbstractNeutronInterface routes = new ArrayList(); + final List routes = new ArrayList<>(); for (final Routes route : router.getRoutes()) { final NeutronRoute routerRoute = new NeutronRoute(); routerRoute.setDestination(String.valueOf(route.getDestination().getValue())); @@ -111,7 +110,7 @@ public final class NeutronRouterInterface extends AbstractNeutronInterface fixedIps = new ArrayList(); + final List fixedIps = new ArrayList<>(); for (final ExternalFixedIps mdFixedIp : router.getExternalGatewayInfo().getExternalFixedIps()) { final NeutronIps fixedIp = new NeutronIps(); fixedIp.setSubnetUUID(String.valueOf(mdFixedIp.getSubnetId().getValue())); diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSubnetInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSubnetInterface.java index c1f82aab8..c428f4e53 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSubnetInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSubnetInterface.java @@ -79,7 +79,7 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface allocationPools = new ArrayList(); + final List allocationPools = new ArrayList<>(); for (final AllocationPools allocationPool : subnet.getAllocationPools()) { final NeutronSubnetIpAllocationPool pool = new NeutronSubnetIpAllocationPool(); pool.setPoolStart(String.valueOf(allocationPool.getStart().getValue())); @@ -89,14 +89,14 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface dnsNameServers = new ArrayList(); + final List dnsNameServers = new ArrayList<>(); for (final IpAddress dnsNameServer : subnet.getDnsNameservers()) { dnsNameServers.add(String.valueOf(dnsNameServer.getValue())); } result.setDnsNameservers(dnsNameServers); } if (subnet.getHostRoutes() != null) { - final List hostRoutes = new ArrayList(); + final List hostRoutes = new ArrayList<>(); for (final HostRoutes hostRoute : subnet.getHostRoutes()) { final NeutronRoute nsHostRoute = new NeutronRoute(); nsHostRoute.setDestination(String.valueOf(hostRoute.getDestination().getValue())); @@ -147,7 +147,7 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface dnsNameServers = new ArrayList(); + final List dnsNameServers = new ArrayList<>(); for (final String dnsNameServer : subnet.getDnsNameservers()) { final IpAddress ipAddress = new IpAddress(dnsNameServer.toCharArray()); dnsNameServers.add(ipAddress); diff --git a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronVpnIpSecSiteConnectionsInterface.java b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronVpnIpSecSiteConnectionsInterface.java index 62db1dfdb..e1737bbfe 100644 --- a/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronVpnIpSecSiteConnectionsInterface.java +++ b/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronVpnIpSecSiteConnectionsInterface.java @@ -41,7 +41,7 @@ public final class NeutronVpnIpSecSiteConnectionsInterface answer.setPeerAddress(ipsecSiteConnection.getPeerAddress()); } if (ipsecSiteConnection.getPeerCidrs() != null) { - final List peerCidrs = new ArrayList(); + final List peerCidrs = new ArrayList<>(); for (final String peerCidr : ipsecSiteConnection.getPeerCidrs()) { peerCidrs.add(peerCidr); } @@ -92,7 +92,7 @@ public final class NeutronVpnIpSecSiteConnectionsInterface ipsecSiteConnectionBuilder.setPeerAddress(ipsecSiteConnection.getPeerAddress()); } if (ipsecSiteConnection.getPeerCidrs() != null) { - final List peerCidrs = new ArrayList(); + final List peerCidrs = new ArrayList<>(); for (final String peerCidr : ipsecSiteConnection.getPeerCidrs()) { peerCidrs.add(peerCidr); } -- 2.36.6