Full <> clean-up 19/29119/2
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 13:18:15 +0000 (14:18 +0100)
Change-Id: I23ce78b0cb4d2f253bc2d0ea8fe4833ff099e8b2
Signed-off-by: Stephen Kitt <skitt@redhat.com>
80 files changed:
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionInstance.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDataChangeListener.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepOperationalCommandAggregator.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/TransactionInvokerImpl.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/message/TableUpdate.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/OvsdbMap.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/typed/TyperUtils.java
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/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/NeutronFirewallPolicy.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/NeutronNetwork.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/NeutronPort.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/NeutronRouter.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/NeutronSecurityGroup.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/NeutronSubnet.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/NeutronSubnetIPAllocationPool.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronFloatingIPInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronLoadBalancerInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronLoadBalancerPoolInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronNetworkInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronPortInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronRouterInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronSecurityGroupInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronSecurityRuleInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronSubnetInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/iaware/impl/NeutronNetworkChangeListener.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/iaware/impl/NeutronPortChangeListener.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/iaware/impl/NeutronRouterChangeListener.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/iaware/impl/NeutronSecurityGroupDataChangeListener.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/iaware/impl/NeutronSubnetChangeListener.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
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstance.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbDataChangeListener.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundMapper.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/DataChangesManagedByOvsdbNodeEvent.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/OvsdbNodeUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactCommandAggregator.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactUtils.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbControllerRemovedCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbOperationalCommandAggregator.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/TransactionInvokerImpl.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstanceTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManagerTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbDataChangeListenerTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/SouthboundMapperTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeOperationalStateTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactCommandAggregatorTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactUtilsTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OpenVSwitchUpdateCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbBridgeRemovedCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbBridgeUpdateCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbControllerRemovedCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbControllerUpdateCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersUpdateCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbOperationalCommandAggregatorTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommandTest.java
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/TransactionInvokerImplTest.java

index 45843d443aaa16fd11a0a6ec945055c5538f4311..dbc9c591f00ece3514cf39e810ae4272726a66dd 100644 (file)
@@ -107,7 +107,7 @@ public class HwvtepConnectionInstance implements OvsdbClient{
     public void createTransactInvokers() {
         if (transactInvokers == null) {
             try {
-                transactInvokers = new HashMap<DatabaseSchema,TransactInvoker>();
+                transactInvokers = new HashMap<>();
                 List<String> databases = getDatabases().get();
                 for (String database : databases) {
                     DatabaseSchema dbSchema = getSchema(database).get();
index f20789572c3430796dc544a4903690fbd03802d0..21fc047aa21c0ebff3348181d16a7bb016b94464 100644 (file)
@@ -46,7 +46,7 @@ public class HwvtepDataChangeListener implements DataTreeChangeListener<Node>, A
 
     private void registerListener(final DataBroker db) {
         final DataTreeIdentifier<Node> treeId =
-                        new DataTreeIdentifier<Node>(LogicalDatastoreType.CONFIGURATION, getWildcardPath());
+                new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, getWildcardPath());
         try {
             LOG.trace("Registering on path: {}", treeId);
             registration = db.registerDataTreeChangeListener(treeId, HwvtepDataChangeListener.this);
index a1607070e71ec161055f1b1c7efcefc4bcffa2a9..94116e37b6c1539789a231f58fcc71f22d236a79 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
 public class HwvtepOperationalCommandAggregator implements TransactionCommand {
 
 
-    private List<TransactionCommand> commands = new ArrayList<TransactionCommand>();
+    private List<TransactionCommand> commands = new ArrayList<>();
 
     public HwvtepOperationalCommandAggregator(HwvtepConnectionInstance key,TableUpdates updates,
             DatabaseSchema dbSchema) {
index 9599464b9bf5642275cfb1c9da5e925f1a820030..8f4ab70059b9d8e5c462f6dc59b85c6b253ce5fb 100644 (file)
@@ -40,15 +40,15 @@ public class TransactionInvokerImpl implements TransactionInvoker,TransactionCha
     private static final int QUEUE_SIZE = 10000;
     private BindingTransactionChain chain;
     private DataBroker db;
-    private BlockingQueue<TransactionCommand> inputQueue = new LinkedBlockingQueue<TransactionCommand>(QUEUE_SIZE);
+    private BlockingQueue<TransactionCommand> inputQueue = new LinkedBlockingQueue<>(QUEUE_SIZE);
     private BlockingQueue<ReadWriteTransaction> successfulTransactionQueue
-        = new LinkedBlockingQueue<ReadWriteTransaction>(QUEUE_SIZE);
+        = new LinkedBlockingQueue<>(QUEUE_SIZE);
     private BlockingQueue<AsyncTransaction<?, ?>> failedTransactionQueue
-        = new LinkedBlockingQueue<AsyncTransaction<?, ?>>(QUEUE_SIZE);
+        = new LinkedBlockingQueue<>(QUEUE_SIZE);
     private ExecutorService executor;
     private Map<ReadWriteTransaction,TransactionCommand> transactionToCommand
-        = new HashMap<ReadWriteTransaction,TransactionCommand>();
-    private List<ReadWriteTransaction> pendingTransactions = new ArrayList<ReadWriteTransaction>();
+        = new HashMap<>();
+    private List<ReadWriteTransaction> pendingTransactions = new ArrayList<>();
 
     public TransactionInvokerImpl(DataBroker db) {
         this.db = db;
@@ -106,7 +106,7 @@ public class TransactionInvokerImpl implements TransactionInvoker,TransactionCha
 
     private List<TransactionCommand> extractResubmitCommands() {
         AsyncTransaction<?, ?> transaction = failedTransactionQueue.poll();
-        List<TransactionCommand> commands = new ArrayList<TransactionCommand>();
+        List<TransactionCommand> commands = new ArrayList<>();
         if (transaction != null) {
             int index = pendingTransactions.lastIndexOf(transaction);
             List<ReadWriteTransaction> transactions =
@@ -122,8 +122,8 @@ public class TransactionInvokerImpl implements TransactionInvoker,TransactionCha
     private void resetTransactionQueue() {
         chain.close();
         chain = db.createTransactionChain(this);
-        pendingTransactions = new ArrayList<ReadWriteTransaction>();
-        transactionToCommand = new HashMap<ReadWriteTransaction,TransactionCommand>();
+        pendingTransactions = new ArrayList<>();
+        transactionToCommand = new HashMap<>();
         failedTransactionQueue.clear();
         successfulTransactionQueue.clear();
     }
@@ -141,7 +141,7 @@ public class TransactionInvokerImpl implements TransactionInvoker,TransactionCha
     }
 
     private List<TransactionCommand> extractCommandsFromQueue() throws InterruptedException {
-        List<TransactionCommand> result = new ArrayList<TransactionCommand>();
+        List<TransactionCommand> result = new ArrayList<>();
         TransactionCommand command = inputQueue.take();
         while (command != null) {
             result.add(command);
index 73497046b4c8a6a26edefa3dba266b87fd4c8258..bc688fb560d82dcab883944a80c41072f47ddd20 100644 (file)
@@ -67,7 +67,7 @@ public class TableUpdate<E extends TableSchema<E>> {
     }
 
     public void addRow(UUID uuid, Row<E> oldRow, Row<E> newRow) {
-        rows.put(uuid, new RowUpdate<E>(uuid, oldRow, newRow));
+        rows.put(uuid, new RowUpdate<>(uuid, oldRow, newRow));
     }
 
     public Row<E> getOld(UUID uuid) {
index 6aaae6c3acd84066b94f97ae84cf968bb5185606..de0e844f664d6fb9a82ee20721a23ddca7954e16 100644 (file)
@@ -38,6 +38,6 @@ public class OvsdbMap<K, V> extends ForwardingMap<K, V> {
     }
 
     public static <K,V> OvsdbMap<K,V> fromMap(Map<K, V> value) {
-        return new OvsdbMap<K,V>(value);
+        return new OvsdbMap<>(value);
     }
 }
index d59121e0675a49f6052949c7691e30d5dc507e5c..0932d95467db307652e577897e29edf4a482f8b6 100644 (file)
@@ -304,7 +304,7 @@ public class TyperUtils {
                 // When the row is null, that might indicate that the user maybe interested
                 // only in the ColumnSchema and not on the Data.
                 if (row == null) {
-                    return new Column<GenericTableSchema, Object>(columnSchema, null);
+                    return new Column<>(columnSchema, null);
                 }
                 return row.getColumn(columnSchema);
             }
index 91a2bed08c8ab609f2881df63ce645cb8f6f9c16..544afd5b049743db9344b980b4312a854d60121a 100644 (file)
@@ -435,7 +435,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 02d6815f6c74f27953d41adb297813b54d86c477..b2861c35d53b9a2b6443d67a402b40aa9974b081 100644 (file)
@@ -33,7 +33,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;
 
     public ConfigActivator(ProviderContext providerContext) {
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 eb9ad7901d526ae9c1b85f7264df09be2b3ecbd2..4cac5378bc952100006720885b37b376af4b428f 100644 (file)
@@ -76,8 +76,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";
@@ -122,7 +122,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 d8b577ca715fb1b15ecc75e7d4fc5828ebbc11d5..26413123533503373ef4af666020d2bd5e07bec6 100644 (file)
@@ -73,8 +73,8 @@ public class IngressAclServiceTest {
     @Mock private SecurityServicesManager securityServices;
     @Mock private SecurityGroupCacheManger securityGroupCacheManger;
 
-    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;
@@ -122,7 +122,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 6b0899a6d32c2321e3ce3f77013c381728251e28..3097b0379463ee107d08b41a9b473a7a2e637821 100644 (file)
@@ -61,7 +61,7 @@ import org.slf4j.LoggerFactory;
 
 public class ConfigActivator implements BundleActivator {
     private static final Logger LOG = LoggerFactory.getLogger(ConfigActivator.class);
-    private List<ServiceRegistration<?>> translatorCRUDRegistrations = new ArrayList<ServiceRegistration<?>>();
+    private List<ServiceRegistration<?>> translatorCRUDRegistrations = new ArrayList<>();
     private List<Pair<Object, ServiceRegistration>> servicesAndRegistrations = new ArrayList<>();
     private ProviderContext providerContext;
 
index f6c2342558c9ed3d2d064feaa887a370c208e651..d2bad1ba2221d22272e8bfda43a83e450c001779 100755 (executable)
@@ -87,7 +87,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 aace8dd861aa9faf5d475fbeae47f881a55cb831..656f087cd26de7bf5028c4baf186e5cb52fe1850 100644 (file)
@@ -79,7 +79,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;
@@ -302,7 +302,7 @@ public class SecurityServicesImpl implements ConfigInterface, SecurityServicesMa
 
     @Override
     public List<Neutron_IPs> getVmListForSecurityGroup(String portUuid, 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 6b84f9f7f68170e86b220c8fe880f862f28e7e5e..b8862345fe44b1cd0be09527eced704eacb64956 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 ad9da39bb8db2ea5256bf6cfd6b6413a0da33a79..511ab4784e180828b94a27620fc929c3809ffca6 100644 (file)
@@ -148,7 +148,7 @@ public class NeutronFirewallPolicy implements Serializable, INeutronObject {
                 ans.setFirewallPolicyIsShared(firewallPolicyIsShared);
             }
             if (s.equals("firewall_rules")) {
-                List<String> firewallRuleList = new ArrayList<String>();
+                List<String> firewallRuleList = new ArrayList<>();
                 firewallRuleList.addAll(this.getFirewallPolicyRules());
                 ans.setFirewallPolicyRules(firewallRuleList);
             }
index b6396dc6e42c782c948201bd0199e572aabca9c6..7c73e63feb54daf6441fdb5d8eee8304e75c1a48 100644 (file)
@@ -81,7 +81,7 @@ public class NeutronNetwork implements Serializable, INeutronObject {
     }
 
     public void initDefaults() {
-        subnets = new ArrayList<String>();
+        subnets = new ArrayList<>();
         if (status == null) {
             status = "ACTIVE";
         }
@@ -253,7 +253,7 @@ public class NeutronNetwork implements Serializable, INeutronObject {
                 ans.setStatus(this.getStatus());
             }
             if (s.equals("subnets")) {
-                List<String> subnetList = new ArrayList<String>();
+                List<String> subnetList = new ArrayList<>();
                 subnetList.addAll(this.getSubnets());
                 ans.setSubnets(subnetList);
             }
index 2608cd47dbf1c53f17e8d3002fda3a3a05a7e32c..b77e4113e1a2929bae9289e2903778b27f93451f 100644 (file)
@@ -274,7 +274,7 @@ public class NeutronPort implements Serializable, INeutronObject {
                 ans.setMacAddress(this.getMacAddress());
             }
             if ("fixed_ips".equals(field)) {
-                ans.setFixedIPs(new ArrayList<Neutron_IPs>(this.getFixedIPs()));
+                ans.setFixedIPs(new ArrayList<>(this.getFixedIPs()));
             }
             if ("device_id".equals(field)) {
                 ans.setDeviceID(this.getDeviceID());
@@ -286,7 +286,7 @@ public class NeutronPort implements Serializable, INeutronObject {
                 ans.setTenantID(this.getTenantID());
             }
             if ("security_groups".equals(field)) {
-                ans.setSecurityGroups(new ArrayList<NeutronSecurityGroup>(this.getSecurityGroups()));
+                ans.setSecurityGroups(new ArrayList<>(this.getSecurityGroups()));
             }
         }
         return ans;
@@ -298,7 +298,7 @@ public class NeutronPort implements Serializable, INeutronObject {
             status = "ACTIVE";
         }
         if (fixedIPs == null) {
-            fixedIPs = new ArrayList<Neutron_IPs>();
+            fixedIPs = new ArrayList<>();
         }
     }
 
index cc64cd055695ab5e1ca53f792ede44272a91edb5..8c049c89851ab5e0cb8320dbe416c2ace4a18b3b 100644 (file)
@@ -60,7 +60,7 @@ public class NeutronRouter implements Serializable, INeutronObject {
     Map<String, NeutronRouter_Interface> interfaces;
 
     public NeutronRouter() {
-        interfaces = new HashMap<String, NeutronRouter_Interface>();
+        interfaces = new HashMap<>();
     }
 
     public String getID() { return routerUUID; }
index 9a5daedf68c7f80a923378126200ed7bc40e4cc9..f517b9a779f8121a51360d9a8c17717a88788443 100644 (file)
@@ -52,7 +52,7 @@ public class NeutronSecurityGroup implements Serializable, INeutronObject {
     List<NeutronSecurityRule> neutronSecurityRule;
 
     public NeutronSecurityGroup() {
-        neutronSecurityRule = new ArrayList<NeutronSecurityRule>();
+        neutronSecurityRule = new ArrayList<>();
 
     }
 
index 9d32fc3e78f1fa4c0e9100aad955eb1a164b04cf..4403d30ff1292677314a54ae96c1d88f1ccfef55 100644 (file)
@@ -94,7 +94,7 @@ public class NeutronSubnet implements Serializable, INeutronObject {
     List<NeutronPort> myPorts;
 
     public NeutronSubnet() {
-        myPorts = new ArrayList<NeutronPort>();
+        myPorts = new ArrayList<>();
     }
 
     // @deprecated - will be removed in Boron
@@ -241,17 +241,17 @@ public class NeutronSubnet implements Serializable, INeutronObject {
                 ans.setGatewayIP(this.getGatewayIP());
             }
             if (s.equals("dns_nameservers")) {
-                List<String> nsList = new ArrayList<String>();
+                List<String> nsList = new ArrayList<>();
                 nsList.addAll(this.getDnsNameservers());
                 ans.setDnsNameservers(nsList);
             }
             if (s.equals("allocation_pools")) {
-                List<NeutronSubnetIPAllocationPool> aPools = new ArrayList<NeutronSubnetIPAllocationPool>();
+                List<NeutronSubnetIPAllocationPool> aPools = new ArrayList<>();
                 aPools.addAll(this.getAllocationPools());
                 ans.setAllocationPools(aPools);
             }
             if (s.equals("host_routes")) {
-                List<NeutronSubnet_HostRoute> hRoutes = new ArrayList<NeutronSubnet_HostRoute>();
+                List<NeutronSubnet_HostRoute> hRoutes = new ArrayList<>();
                 hRoutes.addAll(this.getHostRoutes());
                 ans.setHostRoutes(hRoutes);
             }
@@ -278,7 +278,7 @@ public class NeutronSubnet implements Serializable, INeutronObject {
 
     // @deprecated - will be removed in Boron
     public List<NeutronPort> getPortsInSubnet(String ignore) {
-       List<NeutronPort> answer = new ArrayList<NeutronPort>();
+       List<NeutronPort> answer = new ArrayList<>();
        for (NeutronPort port : myPorts) {
            if (!port.getDeviceOwner().equalsIgnoreCase(ignore)) {
                 answer.add(port);
@@ -360,12 +360,12 @@ public class NeutronSubnet implements Serializable, INeutronObject {
         if (ipVersion == null) {
             ipVersion = IPV4_VERSION;
         }
-        dnsNameservers = new ArrayList<String>();
+        dnsNameservers = new ArrayList<>();
         if (hostRoutes == null) {
-            hostRoutes = new ArrayList<NeutronSubnet_HostRoute>();
+            hostRoutes = new ArrayList<>();
         }
         if (allocationPools == null) {
-            allocationPools = new ArrayList<NeutronSubnetIPAllocationPool>();
+            allocationPools = new ArrayList<>();
             if (ipVersion == IPV4_VERSION) {
                 try {
                     SubnetUtils util = new SubnetUtils(cidr);
index 38f31c74b51653dbab9633452ab24187f97d432d..098f9067f12a3f7e578a9f0bf2e5ede224db4d20 100644 (file)
@@ -211,7 +211,7 @@ public class NeutronSubnetIPAllocationPool implements Serializable {
      * the other ranging from parameter+1 to high
      */
     public List<NeutronSubnetIPAllocationPool> splitPool(String ipAddress) {
-        List<NeutronSubnetIPAllocationPool> ans = new ArrayList<NeutronSubnetIPAllocationPool>();
+        List<NeutronSubnetIPAllocationPool> ans = new ArrayList<>();
         long gIP = NeutronSubnetIPAllocationPool.convert(ipAddress);
         long sIP = NeutronSubnetIPAllocationPool.convert(poolStart);
         long eIP = NeutronSubnetIPAllocationPool.convert(poolEnd);
@@ -277,7 +277,7 @@ public class NeutronSubnetIPAllocationPool implements Serializable {
      * If the pool is a single address, return null
      */
     public List<NeutronSubnetIPAllocationPool> splitPoolV6(String ipAddress) {
-        List<NeutronSubnetIPAllocationPool> ans = new ArrayList<NeutronSubnetIPAllocationPool>();
+        List<NeutronSubnetIPAllocationPool> ans = new ArrayList<>();
         BigInteger gIP = NeutronSubnetIPAllocationPool.convertV6(ipAddress);
         BigInteger sIP = NeutronSubnetIPAllocationPool.convertV6(poolStart);
         BigInteger eIP = NeutronSubnetIPAllocationPool.convertV6(poolEnd);
index 20dc3c37fc9cc266f3392ed1fce8b47fa7c6b87e..c417e6e4220b60a69cab9bec05310f832f4296f7 100644 (file)
@@ -53,7 +53,7 @@ public class NeutronFloatingIPInterface extends AbstractNeutronInterface<Floatin
 
     @Override
     public List<NeutronFloatingIP> getAllFloatingIPs() {
-        Set<NeutronFloatingIP> allIPs = new HashSet<NeutronFloatingIP>();
+        Set<NeutronFloatingIP> allIPs = new HashSet<>();
         Floatingips fips = readMd(createInstanceIdentifier());
         if (fips != null) {
             for (Floatingip fip: fips.getFloatingip()) {
@@ -61,7 +61,7 @@ public class NeutronFloatingIPInterface extends AbstractNeutronInterface<Floatin
             }
         }
         LOGGER.debug("Exiting getAllFloatingIPs, Found {} FloatingIPs", allIPs.size());
-        List<NeutronFloatingIP> ans = new ArrayList<NeutronFloatingIP>();
+        List<NeutronFloatingIP> ans = new ArrayList<>();
         ans.addAll(allIPs);
         return ans;
     }
index 770516e234d4a152b0c9ba67c49584d39d4b1cba..058607de8cc6736f304c803ee095426a35eb87b1 100644 (file)
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
  */
 public class NeutronLoadBalancerInterface extends AbstractNeutronInterface<Loadbalancer, NeutronLoadBalancer> implements INeutronLoadBalancerCRUD {
     private static final Logger LOGGER = LoggerFactory.getLogger(NeutronLoadBalancerInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancer> loadBalancerDB  = new ConcurrentHashMap<String, NeutronLoadBalancer>();
+    private ConcurrentMap<String, NeutronLoadBalancer> loadBalancerDB  = new ConcurrentHashMap<>();
 
 
     NeutronLoadBalancerInterface(ProviderContext providerContext) {
@@ -60,13 +60,13 @@ public class NeutronLoadBalancerInterface extends AbstractNeutronInterface<Loadb
 
     @Override
     public List<NeutronLoadBalancer> getAllNeutronLoadBalancers() {
-        Set<NeutronLoadBalancer> allLoadBalancers = new HashSet<NeutronLoadBalancer>();
+        Set<NeutronLoadBalancer> allLoadBalancers = new HashSet<>();
         for (Entry<String, NeutronLoadBalancer> entry : loadBalancerDB.entrySet()) {
             NeutronLoadBalancer loadBalancer = entry.getValue();
             allLoadBalancers.add(loadBalancer);
         }
         LOGGER.debug("Exiting getLoadBalancers, Found {} OpenStackLoadBalancer", allLoadBalancers.size());
-        List<NeutronLoadBalancer> ans = new ArrayList<NeutronLoadBalancer>();
+        List<NeutronLoadBalancer> ans = new ArrayList<>();
         ans.addAll(allLoadBalancers);
         return ans;
     }
index adc1c3832133fbb3bc86eb57ba22c126265cacb7..a2ffc48efc6ea48575a5fb8426ac22afc59df8f2 100644 (file)
@@ -47,7 +47,7 @@ import com.google.common.collect.ImmutableBiMap;
 
 public class NeutronLoadBalancerPoolInterface extends AbstractNeutronInterface<Pool, NeutronLoadBalancerPool> implements INeutronLoadBalancerPoolCRUD {
     private static final Logger LOGGER = LoggerFactory.getLogger(NeutronLoadBalancerPoolInterface.class);
-    private ConcurrentMap<String, NeutronLoadBalancerPool> loadBalancerPoolDB = new ConcurrentHashMap<String, NeutronLoadBalancerPool>();
+    private ConcurrentMap<String, NeutronLoadBalancerPool> loadBalancerPoolDB = new ConcurrentHashMap<>();
 
     private static final ImmutableBiMap<Class<? extends ProtocolBase>,String> PROTOCOL_MAP
             = new ImmutableBiMap.Builder<Class<? extends ProtocolBase>,String>()
@@ -76,13 +76,13 @@ public class NeutronLoadBalancerPoolInterface extends AbstractNeutronInterface<P
 
     @Override
     public List<NeutronLoadBalancerPool> getAllNeutronLoadBalancerPools() {
-        Set<NeutronLoadBalancerPool> allLoadBalancerPools = new HashSet<NeutronLoadBalancerPool>();
+        Set<NeutronLoadBalancerPool> allLoadBalancerPools = new HashSet<>();
         for (Entry<String, NeutronLoadBalancerPool> entry : loadBalancerPoolDB.entrySet()) {
             NeutronLoadBalancerPool loadBalancerPool = entry.getValue();
             allLoadBalancerPools.add(loadBalancerPool);
         }
         LOGGER.debug("Exiting getLoadBalancerPools, Found {} OpenStackLoadBalancerPool", allLoadBalancerPools.size());
-        List<NeutronLoadBalancerPool> ans = new ArrayList<NeutronLoadBalancerPool>();
+        List<NeutronLoadBalancerPool> ans = new ArrayList<>();
         ans.addAll(allLoadBalancerPools);
         return ans;
     }
@@ -149,7 +149,7 @@ public class NeutronLoadBalancerPoolInterface extends AbstractNeutronInterface<P
             poolBuilder.setLbAlgorithm(pool.getLoadBalancerPoolLbAlgorithm());
         }
         if (pool.getLoadBalancerPoolListeners() != null) {
-            List<Uuid> listListener = new ArrayList<Uuid>();
+            List<Uuid> listListener = new ArrayList<>();
             for (Neutron_ID neutron_id : pool.getLoadBalancerPoolListeners()) {
                 listListener.add(toUuid(neutron_id.getID()));
             }
index 03e38ebe07cb7d04fe184e2de49aa4511d5437ec..4eab3b9baeeef197baf030cd387b7772e6fb0363 100644 (file)
@@ -78,7 +78,7 @@ public class NeutronNetworkInterface extends AbstractNeutronInterface<Network,Ne
 
     @Override
     public List<NeutronNetwork> getAllNetworks() {
-        Set<NeutronNetwork> allNetworks = new HashSet<NeutronNetwork>();
+        Set<NeutronNetwork> allNetworks = new HashSet<>();
         Networks networks = readMd(createInstanceIdentifier());
         if (networks != null) {
             for (Network network: networks.getNetwork()) {
@@ -86,7 +86,7 @@ public class NeutronNetworkInterface extends AbstractNeutronInterface<Network,Ne
             }
         }
         LOGGER.debug("Exiting getAllNetworks, Found {} OpenStackNetworks", allNetworks.size());
-        List<NeutronNetwork> ans = new ArrayList<NeutronNetwork>();
+        List<NeutronNetwork> ans = new ArrayList<>();
         ans.addAll(allNetworks);
         return ans;
     }
@@ -135,7 +135,7 @@ public class NeutronNetworkInterface extends AbstractNeutronInterface<Network,Ne
         result.setShared(network.isShared());
         result.setStatus(network.getStatus());
         if (network.getSubnets() != null) {
-            List<String> neutronSubnets = new ArrayList<String>();
+            List<String> neutronSubnets = new ArrayList<>();
             for( Uuid subnet : network.getSubnets()) {
                neutronSubnets.add(subnet.getValue());
             }
@@ -152,7 +152,7 @@ public class NeutronNetworkInterface extends AbstractNeutronInterface<Network,Ne
         result.setProviderPhysicalNetwork(providerExtension.getPhysicalNetwork());
         result.setProviderSegmentationID(providerExtension.getSegmentationId());
         result.setProviderNetworkType(NETWORK_MAP.get(providerExtension.getNetworkType()));
-        List<NeutronNetwork_Segment> segments = new ArrayList<NeutronNetwork_Segment>();
+        List<NeutronNetwork_Segment> segments = new ArrayList<>();
         if (providerExtension.getSegments() != null) {
             for (Segments segment: providerExtension.getSegments()) {
                 NeutronNetwork_Segment neutronSegment = new NeutronNetwork_Segment();
@@ -186,7 +186,7 @@ public class NeutronNetworkInterface extends AbstractNeutronInterface<Network,Ne
             providerExtensionBuilder.setNetworkType((Class<? extends NetworkTypeBase>) mapper.get(network.getProviderNetworkType()));
         }
         if (network.getSegments() != null) {
-            List<Segments> segments = new ArrayList<Segments>();
+            List<Segments> segments = new ArrayList<>();
             long count = 0;
             for( NeutronNetwork_Segment segment : network.getSegments()) {
                 count++;
@@ -232,7 +232,7 @@ public class NeutronNetworkInterface extends AbstractNeutronInterface<Network,Ne
             networkBuilder.setStatus(network.getStatus());
         }
         if (network.getSubnets() != null) {
-            List<Uuid> subnets = new ArrayList<Uuid>();
+            List<Uuid> subnets = new ArrayList<>();
             for( String subnet : network.getSubnets()) {
                 subnets.add(toUuid(subnet));
             }
index c1ab927846ce9d336697622db7b2719610aaf0b5..08d0d4d502f48b889e5457858e7dbffb58eccc66 100644 (file)
@@ -71,7 +71,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
 
     @Override
     public List<NeutronPort> getAllPorts() {
-        Set<NeutronPort> allPorts = new HashSet<NeutronPort>();
+        Set<NeutronPort> allPorts = new HashSet<>();
         Ports ports = readMd(createInstanceIdentifier());
         if (ports != null) {
             for (Port port : ports.getPort()) {
@@ -79,7 +79,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
             }
         }
         LOGGER.debug("Exiting getAllPorts, Found {} OpenStackPorts", allPorts.size());
-        List<NeutronPort> ans = new ArrayList<NeutronPort>();
+        List<NeutronPort> ans = new ArrayList<>();
         ans.addAll(allPorts);
         return ans;
     }
@@ -138,7 +138,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
         PortBindingExtension binding = port.getAugmentation(PortBindingExtension.class);
         result.setBindinghostID(binding.getHostId());
         if (binding.getVifDetails() != null) {
-            List<NeutronPort_VIFDetail> details = new ArrayList<NeutronPort_VIFDetail>();
+            List<NeutronPort_VIFDetail> details = new ArrayList<>();
             for (VifDetails vifDetail : binding.getVifDetails()) {
                 NeutronPort_VIFDetail detail = new NeutronPort_VIFDetail();
                 detail.setPortFilter(vifDetail.isPortFilter());
@@ -155,7 +155,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
         NeutronPort result = new NeutronPort();
         result.setAdminStateUp(port.isAdminStateUp());
         if (port.getAllowedAddressPairs() != null) {
-            List<NeutronPort_AllowedAddressPairs> pairs = new ArrayList<NeutronPort_AllowedAddressPairs>();
+            List<NeutronPort_AllowedAddressPairs> pairs = new ArrayList<>();
             for (AllowedAddressPairs mdPair : port.getAllowedAddressPairs()) {
                 NeutronPort_AllowedAddressPairs pair = new NeutronPort_AllowedAddressPairs();
                 pair.setIpAddress(mdPair.getIpAddress());
@@ -168,7 +168,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
         result.setDeviceID(port.getDeviceId());
         result.setDeviceOwner(port.getDeviceOwner());
         if (port.getExtraDhcpOpts() != null) {
-            List<NeutronPort_ExtraDHCPOption> options = new ArrayList<NeutronPort_ExtraDHCPOption>();
+            List<NeutronPort_ExtraDHCPOption> options = new ArrayList<>();
             for (ExtraDhcpOpts opt : port.getExtraDhcpOpts()) {
                 NeutronPort_ExtraDHCPOption arg = new NeutronPort_ExtraDHCPOption();
                 arg.setName(opt.getOptName());
@@ -178,7 +178,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
             result.setExtraDHCPOptions(options);
         }
         if (port.getFixedIps() != null) {
-            List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
+            List<Neutron_IPs> ips = new ArrayList<>();
             for (FixedIps mdIP : port.getFixedIps()) {
                 Neutron_IPs ip = new Neutron_IPs();
                 ip.setIpAddress(String.valueOf(mdIP.getIpAddress().getValue()));
@@ -191,13 +191,13 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
         result.setName(port.getName());
         result.setNetworkUUID(String.valueOf(port.getNetworkId().getValue()));
         if (port.getSecurityGroups() != null) {
-            Set<NeutronSecurityGroup> allGroups = new HashSet<NeutronSecurityGroup>();
+            Set<NeutronSecurityGroup> allGroups = new HashSet<>();
             NeutronCRUDInterfaces interfaces = new NeutronCRUDInterfaces().fetchINeutronSecurityGroupCRUD(this);
             INeutronSecurityGroupCRUD sgIf = interfaces.getSecurityGroupInterface();
             for (Uuid sgUuid : port.getSecurityGroups()) {
                 allGroups.add(sgIf.getNeutronSecurityGroup(sgUuid.getValue()));
             }
-            List<NeutronSecurityGroup> groups = new ArrayList<NeutronSecurityGroup>();
+            List<NeutronSecurityGroup> groups = new ArrayList<>();
             groups.addAll(allGroups);
             result.setSecurityGroups(groups);
         }
@@ -217,7 +217,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
             bindingBuilder.setHostId(neutronPort.getBindinghostID());
         }
         if (neutronPort.getVIFDetail() != null) {
-            List<VifDetails> listVifDetail = new ArrayList<VifDetails>();
+            List<VifDetails> listVifDetail = new ArrayList<>();
             for (NeutronPort_VIFDetail detail: neutronPort.getVIFDetail()) {
                 VifDetailsBuilder vifDetailsBuilder = new VifDetailsBuilder();
                 if (detail.getPortFilter() != null) {
@@ -242,7 +242,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
                                     bindingBuilder.build());
         portBuilder.setAdminStateUp(neutronPort.isAdminStateUp());
         if(neutronPort.getAllowedAddressPairs() != null) {
-            List<AllowedAddressPairs> listAllowedAddressPairs = new ArrayList<AllowedAddressPairs>();
+            List<AllowedAddressPairs> listAllowedAddressPairs = new ArrayList<>();
             for (NeutronPort_AllowedAddressPairs allowedAddressPairs : neutronPort.getAllowedAddressPairs()) {
                     AllowedAddressPairsBuilder allowedAddressPairsBuilder = new AllowedAddressPairsBuilder();
                     allowedAddressPairsBuilder.setIpAddress(allowedAddressPairs.getIpAddress());
@@ -259,7 +259,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
         portBuilder.setDeviceOwner(neutronPort.getDeviceOwner());
         }
         if (neutronPort.getExtraDHCPOptions() != null) {
-            List<ExtraDhcpOpts> listExtraDHCPOptions = new ArrayList<ExtraDhcpOpts>();
+            List<ExtraDhcpOpts> listExtraDHCPOptions = new ArrayList<>();
             for (NeutronPort_ExtraDHCPOption extraDHCPOption : neutronPort.getExtraDHCPOptions()) {
                 ExtraDhcpOptsBuilder extraDHCPOptsBuilder = new ExtraDhcpOptsBuilder();
                 extraDHCPOptsBuilder.setOptName(extraDHCPOption.getName());
@@ -269,7 +269,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
             portBuilder.setExtraDhcpOpts(listExtraDHCPOptions);
         }
         if (neutronPort.getFixedIPs() != null) {
-            List<FixedIps> listNeutronIPs = new ArrayList<FixedIps>();
+            List<FixedIps> listNeutronIPs = new ArrayList<>();
             for (Neutron_IPs neutron_IPs : neutronPort.getFixedIPs()) {
                 FixedIpsBuilder fixedIpsBuilder = new FixedIpsBuilder();
                 fixedIpsBuilder.setIpAddress(new IpAddress(neutron_IPs.getIpAddress().toCharArray()));
@@ -288,7 +288,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
         portBuilder.setNetworkId(toUuid(neutronPort.getNetworkUUID()));
         }
         if (neutronPort.getSecurityGroups() != null) {
-            List<Uuid> listSecurityGroups = new ArrayList<Uuid>();
+            List<Uuid> listSecurityGroups = new ArrayList<>();
             for (NeutronSecurityGroup neutronSecurityGroup : neutronPort.getSecurityGroups()) {
                 listSecurityGroups.add(toUuid(neutronSecurityGroup.getID()));
             }
index a1ab29329bc1e4144ded1ae1a5e7b17a5f6cfd43..fbaafe20f7e815c83d53592cd22152747378a0ba 100644 (file)
@@ -67,7 +67,7 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
 
     @Override
     public List<NeutronRouter> getAllRouters() {
-        Set<NeutronRouter> allRouters = new HashSet<NeutronRouter>();
+        Set<NeutronRouter> allRouters = new HashSet<>();
         Routers routers = readMd(createInstanceIdentifier());
         if (routers != null) {
             for (Router router: routers.getRouter()) {
@@ -75,7 +75,7 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
             }
         }
         LOGGER.debug("Exiting getAllRouters, Found {} Routers", allRouters.size());
-        List<NeutronRouter> ans = new ArrayList<NeutronRouter>();
+        List<NeutronRouter> ans = new ArrayList<>();
         ans.addAll(allRouters);
         return ans;
     }
@@ -138,7 +138,7 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
         routerBuilder.setAdminStateUp(router.getAdminStateUp());
         routerBuilder.setDistributed(router.getDistributed());
         if (router.getRoutes() != null) {
-            List<String> routes = new ArrayList<String>();
+            List<String> routes = new ArrayList<>();
             for (String route : router.getRoutes()) {
                 routes.add(route);
             }
@@ -146,14 +146,14 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
         }
         if (router.getExternalGatewayInfo() != null) {
             ExternalGatewayInfo externalGatewayInfo = null;
-            List<NeutronRouter_NetworkReference> neutronRouter_NetworkReferences = new ArrayList<NeutronRouter_NetworkReference>();
+            List<NeutronRouter_NetworkReference> neutronRouter_NetworkReferences = new ArrayList<>();
             neutronRouter_NetworkReferences.add(router.getExternalGatewayInfo());
             for (NeutronRouter_NetworkReference externalGatewayInfos : neutronRouter_NetworkReferences) {
                 ExternalGatewayInfoBuilder builder = new ExternalGatewayInfoBuilder();
                 builder.setEnableSnat(externalGatewayInfos.getEnableSNAT());
                 builder.setExternalNetworkId(toUuid(externalGatewayInfos.getNetworkID()));
                 if (externalGatewayInfos.getExternalFixedIPs() != null) {
-                    List<ExternalFixedIps> externalFixedIps = new ArrayList<ExternalFixedIps>();
+                    List<ExternalFixedIps> externalFixedIps = new ArrayList<>();
                     for (Neutron_IPs eIP : externalGatewayInfos.getExternalFixedIPs()) {
                         ExternalFixedIpsBuilder eFixedIpBuilder = new ExternalFixedIpsBuilder();
                         eFixedIpBuilder.setIpAddress(new IpAddress(eIP.getIpAddress().toCharArray()));
@@ -167,8 +167,8 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
             routerBuilder.setExternalGatewayInfo(externalGatewayInfo);
         }
         if (router.getInterfaces() != null) {
-            Map<String, NeutronRouter_Interface> mapInterfaces = new HashMap<String, NeutronRouter_Interface>();
-            List<Interfaces> interfaces = new ArrayList<Interfaces>();
+            Map<String, NeutronRouter_Interface> mapInterfaces = new HashMap<>();
+            List<Interfaces> interfaces = new ArrayList<>();
             for (Entry<String, NeutronRouter_Interface> entry : mapInterfaces.entrySet()) {
                 interfaces.add((Interfaces) entry.getValue());
             }
@@ -212,7 +212,7 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
             result.setGatewayPortId(String.valueOf(router.getGatewayPortId().getValue()));
         }
         if (router.getRoutes() != null) {
-            List<String> routes = new ArrayList<String>();
+            List<String> routes = new ArrayList<>();
             for (String route : router.getRoutes()) {
                 routes.add(route);
             }
@@ -224,7 +224,7 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
             extGwInfo.setNetworkID(String.valueOf(router.getExternalGatewayInfo().getExternalNetworkId().getValue()));
             extGwInfo.setEnableSNAT(router.getExternalGatewayInfo().isEnableSnat());
             if (router.getExternalGatewayInfo().getExternalFixedIps() != null) {
-                List<Neutron_IPs> fixedIPs = new ArrayList<Neutron_IPs>();
+                List<Neutron_IPs> fixedIPs = new ArrayList<>();
                 for (ExternalFixedIps mdFixedIP : router.getExternalGatewayInfo().getExternalFixedIps()) {
                      Neutron_IPs fixedIP = new Neutron_IPs();
                      fixedIP.setSubnetUUID(String.valueOf(mdFixedIP.getSubnetId().getValue()));
@@ -237,7 +237,7 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
         }
 
         if (router.getInterfaces() != null) {
-            Map<String, NeutronRouter_Interface> interfaces = new HashMap<String, NeutronRouter_Interface>();
+            Map<String, NeutronRouter_Interface> interfaces = new HashMap<>();
             for (Interfaces mdInterface : router.getInterfaces()) {
                 NeutronRouter_Interface pojoInterface = new NeutronRouter_Interface();
                 String id = String.valueOf(mdInterface.getUuid().getValue());
index c30dd5c49e44038d0cfc4e6b28a8932c3aaf5594..9c72959492e3c0ae0c39e0c37f764fb06598fe3b 100644 (file)
@@ -59,7 +59,7 @@ public class NeutronSecurityGroupInterface extends AbstractNeutronInterface<Secu
 
     @Override
     public List<NeutronSecurityGroup> getAllNeutronSecurityGroups() {
-        Set<NeutronSecurityGroup> allSecurityGroups = new HashSet<NeutronSecurityGroup>();
+        Set<NeutronSecurityGroup> allSecurityGroups = new HashSet<>();
         SecurityGroups groups = readMd(createInstanceIdentifier());
         if (groups != null) {
             for (SecurityGroup group: groups.getSecurityGroup()) {
@@ -67,7 +67,7 @@ public class NeutronSecurityGroupInterface extends AbstractNeutronInterface<Secu
             }
         }
         LOGGER.debug("Exiting getSecurityGroups, Found {} OpenStackSecurityGroup", allSecurityGroups.size());
-        List<NeutronSecurityGroup> ans = new ArrayList<NeutronSecurityGroup>();
+        List<NeutronSecurityGroup> ans = new ArrayList<>();
         ans.addAll(allSecurityGroups);
         return ans;
     }
@@ -120,7 +120,7 @@ public class NeutronSecurityGroupInterface extends AbstractNeutronInterface<Secu
                 .fetchINeutronSecurityRuleCRUD(this);
             INeutronSecurityRuleCRUD srCrud = interfaces.getSecurityRuleInterface();
 
-            List<NeutronSecurityRule> rules = new ArrayList<NeutronSecurityRule>();
+            List<NeutronSecurityRule> rules = new ArrayList<>();
             for (Uuid uuid: group.getSecurityRules()) {
                  rules.add(srCrud.getNeutronSecurityRule(uuid.getValue()));
             }
@@ -145,7 +145,7 @@ public class NeutronSecurityGroupInterface extends AbstractNeutronInterface<Secu
             securityGroupBuilder.setTenantId(toUuid(securityGroup.getSecurityGroupTenantID()));
         }
         if (securityGroup.getSecurityRules() != null) {
-            List<Uuid> neutronSecurityRule = new ArrayList<Uuid>();
+            List<Uuid> neutronSecurityRule = new ArrayList<>();
             for (NeutronSecurityRule securityRule : securityGroup.getSecurityRules()) {
                 if (securityRule.getID() != null) {
                     neutronSecurityRule.add(toUuid(securityRule.getID()));
index cfcc9cd8a4103b2db68020ddd6379cdea2bbdd2e..4fdb7708dc255169bb31567e0840cc6f702cc9c3 100644 (file)
@@ -94,7 +94,7 @@ public class NeutronSecurityRuleInterface extends AbstractNeutronInterface<Secur
         INeutronSecurityGroupCRUD sgCrud = interfaces.getSecurityGroupInterface();
         NeutronSecurityGroup sg = sgCrud.getNeutronSecurityGroup(input.getSecurityRuleGroupID());
         if(sg != null && sg.getSecurityRules() != null) {
-            List<NeutronSecurityRule> toRemove = new ArrayList<NeutronSecurityRule>();
+            List<NeutronSecurityRule> toRemove = new ArrayList<>();
             for(NeutronSecurityRule sgr :sg.getSecurityRules()) {
                 if(sgr.getID() != null && sgr.getID().equals(input.getID())) {
                     toRemove.add(sgr);
@@ -124,7 +124,7 @@ public class NeutronSecurityRuleInterface extends AbstractNeutronInterface<Secur
 
     @Override
     public List<NeutronSecurityRule> getAllNeutronSecurityRules() {
-        Set<NeutronSecurityRule> allSecurityRules = new HashSet<NeutronSecurityRule>();
+        Set<NeutronSecurityRule> allSecurityRules = new HashSet<>();
         SecurityRules rules = readMd(createInstanceIdentifier());
         if (rules != null) {
             for (SecurityRule rule: rules.getSecurityRule()) {
@@ -132,7 +132,7 @@ public class NeutronSecurityRuleInterface extends AbstractNeutronInterface<Secur
             }
         }
         LOGGER.debug("Exiting getSecurityRule, Found {} OpenStackSecurityRule", allSecurityRules.size());
-        List<NeutronSecurityRule> ans = new ArrayList<NeutronSecurityRule>();
+        List<NeutronSecurityRule> ans = new ArrayList<>();
         ans.addAll(allSecurityRules);
         return ans;
     }
index fd228087f7c60f06b04ef843d53c2794ea09da37..ac53d64e7107d11e04d6579e4ed7b382e7a54fcb 100644 (file)
@@ -89,7 +89,7 @@ public class NeutronSubnetInterface extends AbstractNeutronInterface<Subnet, Neu
 
     @Override
     public List<NeutronSubnet> getAllSubnets() {
-        Set<NeutronSubnet> allSubnets = new HashSet<NeutronSubnet>();
+        Set<NeutronSubnet> allSubnets = new HashSet<>();
         Subnets subnets = readMd(createInstanceIdentifier());
         if (subnets != null) {
             for (Subnet subnet: subnets.getSubnet()) {
@@ -97,7 +97,7 @@ public class NeutronSubnetInterface extends AbstractNeutronInterface<Subnet, Neu
             }
         }
         LOGGER.debug("Exiting getAllSubnets, Found {} OpenStackSubnets", allSubnets.size());
-        List<NeutronSubnet> ans = new ArrayList<NeutronSubnet>();
+        List<NeutronSubnet> ans = new ArrayList<>();
         ans.addAll(allSubnets);
         return ans;
     }
@@ -164,7 +164,7 @@ public class NeutronSubnetInterface extends AbstractNeutronInterface<Subnet, Neu
         result.setIpV6AddressMode(DHCPV6_MAP.get(subnet.getIpv6AddressMode()));
         result.setEnableDHCP(subnet.isEnableDhcp());
         if (subnet.getAllocationPools() != null) {
-            List<NeutronSubnetIPAllocationPool> allocationPools = new ArrayList<NeutronSubnetIPAllocationPool>();
+            List<NeutronSubnetIPAllocationPool> allocationPools = new ArrayList<>();
             for (AllocationPools allocationPool : subnet.getAllocationPools()) {
                 NeutronSubnetIPAllocationPool pool = new NeutronSubnetIPAllocationPool();
                 pool.setPoolStart(allocationPool.getStart());
@@ -174,7 +174,7 @@ public class NeutronSubnetInterface extends AbstractNeutronInterface<Subnet, Neu
             result.setAllocationPools(allocationPools);
         }
         if (subnet.getDnsNameservers() != null) {
-            List<String> dnsNameServers = new ArrayList<String>();
+            List<String> dnsNameServers = new ArrayList<>();
             for (IpAddress dnsNameServer : subnet.getDnsNameservers()) {
                 dnsNameServers.add(String.valueOf(dnsNameServer.getValue()));
             }
@@ -184,7 +184,7 @@ public class NeutronSubnetInterface extends AbstractNeutronInterface<Subnet, Neu
 // read through the ports and put the ones in this subnet into the internal
 // myPorts object.
 // @deprecated and will be removed in Boron
-        Set<NeutronPort> allPorts = new HashSet<NeutronPort>();
+        Set<NeutronPort> allPorts = new HashSet<>();
         NeutronCRUDInterfaces interfaces = new NeutronCRUDInterfaces()
             .fetchINeutronPortCRUD(this);
         INeutronPortCRUD portIf = interfaces.getPortInterface();
@@ -197,7 +197,7 @@ public class NeutronSubnetInterface extends AbstractNeutronInterface<Subnet, Neu
                 }
             }
         }
-        List<NeutronPort> ports = new ArrayList<NeutronPort>();
+        List<NeutronPort> ports = new ArrayList<>();
         ports.addAll(allPorts);
         result.setPorts(ports);
         return result;
@@ -240,7 +240,7 @@ public class NeutronSubnetInterface extends AbstractNeutronInterface<Subnet, Neu
         }
         subnetBuilder.setEnableDhcp(subnet.getEnableDHCP());
         if (subnet.getAllocationPools() != null) {
-            List<AllocationPools> allocationPools = new ArrayList<AllocationPools>();
+            List<AllocationPools> allocationPools = new ArrayList<>();
             for (NeutronSubnetIPAllocationPool allocationPool : subnet
                     .getAllocationPools()) {
                 AllocationPoolsBuilder builder = new AllocationPoolsBuilder();
@@ -252,7 +252,7 @@ public class NeutronSubnetInterface extends AbstractNeutronInterface<Subnet, Neu
             subnetBuilder.setAllocationPools(allocationPools);
         }
         if (subnet.getDnsNameservers() != null) {
-            List<IpAddress> dnsNameServers = new ArrayList<IpAddress>();
+            List<IpAddress> dnsNameServers = new ArrayList<>();
             for (String dnsNameServer : subnet.getDnsNameservers()) {
                 IpAddress ipAddress = new IpAddress(dnsNameServer.toCharArray());
                 dnsNameServers.add(ipAddress);
index bb045b4a8eebd9e20b4d422bbecc31b58821e2ad..ae035a04ff8ad1c65f75a9db9bfd1465b9060de4 100644 (file)
@@ -129,7 +129,7 @@ public class NeutronNetworkChangeListener implements DataChangeListener, AutoClo
         result.setShared(network.isShared());
         result.setStatus(network.getStatus());
         if (network.getSubnets() != null) {
-            List<String> neutronSubnets = new ArrayList<String>();
+            List<String> neutronSubnets = new ArrayList<>();
             for( Uuid subnet : network.getSubnets()) {
                neutronSubnets.add(subnet.getValue());
             }
@@ -147,7 +147,7 @@ public class NeutronNetworkChangeListener implements DataChangeListener, AutoClo
         result.setProviderPhysicalNetwork(providerExtension.getPhysicalNetwork());
         result.setProviderSegmentationID(providerExtension.getSegmentationId());
         result.setProviderNetworkType(NETWORK_MAP.get(providerExtension.getNetworkType()));
-        List<NeutronNetwork_Segment> segments = new ArrayList<NeutronNetwork_Segment>();
+        List<NeutronNetwork_Segment> segments = new ArrayList<>();
         if (providerExtension.getSegments() != null) {
             for (Segments segment: providerExtension.getSegments()) {
                 NeutronNetwork_Segment neutronSegment = new NeutronNetwork_Segment();
index 35bf7ff30cbae64b3c23de5dc6409fdaa1af619f..001cfedfad8560e82e50a7fb4d6b9a4220ed96f7 100644 (file)
@@ -131,7 +131,7 @@ public class NeutronPortChangeListener implements DataChangeListener, AutoClosea
         NeutronPort result = new NeutronPort();
         result.setAdminStateUp(port.isAdminStateUp());
         if (port.getAllowedAddressPairs() != null) {
-            List<NeutronPort_AllowedAddressPairs> pairs = new ArrayList<NeutronPort_AllowedAddressPairs>();
+            List<NeutronPort_AllowedAddressPairs> pairs = new ArrayList<>();
             for (AllowedAddressPairs mdPair : port.getAllowedAddressPairs()) {
                 NeutronPort_AllowedAddressPairs pair = new NeutronPort_AllowedAddressPairs();
                 pair.setIpAddress(mdPair.getIpAddress());
@@ -144,7 +144,7 @@ public class NeutronPortChangeListener implements DataChangeListener, AutoClosea
         result.setDeviceID(port.getDeviceId());
         result.setDeviceOwner(port.getDeviceOwner());
         if (port.getExtraDhcpOpts() != null) {
-            List<NeutronPort_ExtraDHCPOption> options = new ArrayList<NeutronPort_ExtraDHCPOption>();
+            List<NeutronPort_ExtraDHCPOption> options = new ArrayList<>();
             for (ExtraDhcpOpts opt : port.getExtraDhcpOpts()) {
                 NeutronPort_ExtraDHCPOption arg = new NeutronPort_ExtraDHCPOption();
                 arg.setName(opt.getOptName());
@@ -154,7 +154,7 @@ public class NeutronPortChangeListener implements DataChangeListener, AutoClosea
             result.setExtraDHCPOptions(options);
         }
         if (port.getFixedIps() != null) {
-            List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
+            List<Neutron_IPs> ips = new ArrayList<>();
             for (FixedIps mdIP : port.getFixedIps()) {
                 Neutron_IPs ip = new Neutron_IPs();
                 ip.setIpAddress(String.valueOf(mdIP.getIpAddress().getValue()));
@@ -167,13 +167,13 @@ public class NeutronPortChangeListener implements DataChangeListener, AutoClosea
         result.setName(port.getName());
         result.setNetworkUUID(String.valueOf(port.getNetworkId().getValue()));
         if (port.getSecurityGroups() != null) {
-            Set<NeutronSecurityGroup> allGroups = new HashSet<NeutronSecurityGroup>();
+            Set<NeutronSecurityGroup> allGroups = new HashSet<>();
             NeutronCRUDInterfaces interfaces = new NeutronCRUDInterfaces().fetchINeutronSecurityGroupCRUD(this);
             INeutronSecurityGroupCRUD sgIf = interfaces.getSecurityGroupInterface();
             for (Uuid sgUuid : port.getSecurityGroups()) {
                 allGroups.add(sgIf.getNeutronSecurityGroup(sgUuid.getValue()));
             }
-            List<NeutronSecurityGroup> groups = new ArrayList<NeutronSecurityGroup>();
+            List<NeutronSecurityGroup> groups = new ArrayList<>();
             groups.addAll(allGroups);
             result.setSecurityGroups(groups);
         }
@@ -190,7 +190,7 @@ public class NeutronPortChangeListener implements DataChangeListener, AutoClosea
         PortBindingExtension binding = port.getAugmentation(PortBindingExtension.class);
         result.setBindinghostID(binding.getHostId());
         if (binding.getVifDetails() != null) {
-            List<NeutronPort_VIFDetail> details = new ArrayList<NeutronPort_VIFDetail>();
+            List<NeutronPort_VIFDetail> details = new ArrayList<>();
             for (VifDetails vifDetail : binding.getVifDetails()) {
                 NeutronPort_VIFDetail detail = new NeutronPort_VIFDetail();
                 detail.setPortFilter(vifDetail.isPortFilter());
@@ -205,7 +205,7 @@ public class NeutronPortChangeListener implements DataChangeListener, AutoClosea
 
     private  Map<String,NeutronPort> getChangedPorts(Map<InstanceIdentifier<?>, DataObject> changedData) {
         LOG.trace("getChangedPorts:" + changedData);
-        Map<String,NeutronPort> portMap = new HashMap<String,NeutronPort>();
+        Map<String,NeutronPort> portMap = new HashMap<>();
         for (Map.Entry<InstanceIdentifier<?>, DataObject> changed : changedData.entrySet()) {
             if (changed.getValue() instanceof Port) {
                 NeutronPort port = fromMd((Port)changed.getValue());
index 5ad885d395540a633d2584bf5057249c4827db8c..a45c0a48b169bbf7deb23e4cf8b00653acd8d2d5 100644 (file)
@@ -122,7 +122,7 @@ public class NeutronRouterChangeListener implements DataChangeListener, AutoClos
             result.setGatewayPortId(String.valueOf(router.getGatewayPortId().getValue()));
         }
         if (router.getRoutes() != null) {
-            List<String> routes = new ArrayList<String>();
+            List<String> routes = new ArrayList<>();
             for (String route : router.getRoutes()) {
                 routes.add(route);
             }
@@ -134,7 +134,7 @@ public class NeutronRouterChangeListener implements DataChangeListener, AutoClos
             extGwInfo.setNetworkID(String.valueOf(router.getExternalGatewayInfo().getExternalNetworkId().getValue()));
             extGwInfo.setEnableSNAT(router.getExternalGatewayInfo().isEnableSnat());
             if (router.getExternalGatewayInfo().getExternalFixedIps() != null) {
-                List<Neutron_IPs> fixedIPs = new ArrayList<Neutron_IPs>();
+                List<Neutron_IPs> fixedIPs = new ArrayList<>();
                 for (ExternalFixedIps mdFixedIP : router.getExternalGatewayInfo().getExternalFixedIps()) {
                      Neutron_IPs fixedIP = new Neutron_IPs();
                      fixedIP.setSubnetUUID(String.valueOf(mdFixedIP.getSubnetId().getValue()));
@@ -147,7 +147,7 @@ public class NeutronRouterChangeListener implements DataChangeListener, AutoClos
         }
 
         if (router.getInterfaces() != null) {
-            Map<String, NeutronRouter_Interface> interfaces = new HashMap<String, NeutronRouter_Interface>();
+            Map<String, NeutronRouter_Interface> interfaces = new HashMap<>();
             for (Interfaces mdInterface : router.getInterfaces()) {
                 NeutronRouter_Interface pojoInterface = new NeutronRouter_Interface();
                 String id = String.valueOf(mdInterface.getUuid().getValue());
index 796d1b1c2f86778b3c86bf05080aec37155d330e..335de4f04f8836349236aa2b38852c39cb8d9db2 100644 (file)
@@ -131,7 +131,7 @@ public class NeutronSecurityGroupDataChangeListener implements
             INeutronSecurityRuleCRUD srCrud = interfaces
                     .getSecurityRuleInterface();
 
-            List<NeutronSecurityRule> rules = new ArrayList<NeutronSecurityRule>();
+            List<NeutronSecurityRule> rules = new ArrayList<>();
             for (Uuid uuid : group.getSecurityRules()) {
                 rules.add(srCrud.getNeutronSecurityRule(uuid.getValue()));
             }
index 7f3073aec1f06ee6cc91d6b51689fccc9ab1de35..c8af0c5f17662191cbee4a71b29cdca69cdc35b5 100644 (file)
@@ -147,7 +147,7 @@ public class NeutronSubnetChangeListener implements DataChangeListener, AutoClos
         result.setIpV6AddressMode(DHCPV6_MAP.get(subnet.getIpv6AddressMode()));
         result.setEnableDHCP(subnet.isEnableDhcp());
         if (subnet.getAllocationPools() != null) {
-            List<NeutronSubnetIPAllocationPool> allocationPools = new ArrayList<NeutronSubnetIPAllocationPool>();
+            List<NeutronSubnetIPAllocationPool> allocationPools = new ArrayList<>();
             for (AllocationPools allocationPool : subnet.getAllocationPools()) {
                 NeutronSubnetIPAllocationPool pool = new NeutronSubnetIPAllocationPool();
                 pool.setPoolStart(allocationPool.getStart());
@@ -157,7 +157,7 @@ public class NeutronSubnetChangeListener implements DataChangeListener, AutoClos
             result.setAllocationPools(allocationPools);
         }
         if (subnet.getDnsNameservers() != null) {
-            List<String> dnsNameServers = new ArrayList<String>();
+            List<String> dnsNameServers = new ArrayList<>();
             for (IpAddress dnsNameServer : subnet.getDnsNameservers()) {
                 dnsNameServers.add(String.valueOf(dnsNameServer.getValue()));
             }
@@ -167,7 +167,7 @@ public class NeutronSubnetChangeListener implements DataChangeListener, AutoClos
 
         // read through the ports and put the ones in this subnet into the internal
         // myPorts object.
-       Set<NeutronPort> allPorts = new HashSet<NeutronPort>();
+       Set<NeutronPort> allPorts = new HashSet<>();
         NeutronCRUDInterfaces interfaces = new NeutronCRUDInterfaces()
             .fetchINeutronPortCRUD(this);
         INeutronPortCRUD portIf = interfaces.getPortInterface();
@@ -180,7 +180,7 @@ public class NeutronSubnetChangeListener implements DataChangeListener, AutoClos
                 }
             }
         }
-        List<NeutronPort> ports = new ArrayList<NeutronPort>();
+        List<NeutronPort> ports = new ArrayList<>();
         ports.addAll(allPorts);
         result.setPorts(ports);
         return result;
index 52458c6e9b6161015e647111db1e458cd2181ea4..35317e0d443317a7318c50b3c7240308f2239794 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 d9c99df1157fa55764f30be120f52c55da8ee4fd..ee02019085076b70016da10c46722e8f2cbfa397 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 61b9e10d906665e1dba0b9795b1d03e9d4f2123c..fce0462938234e4239008633ecf6560b6a00504f 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 9e1e4859d5083dd310e9e6f8eb2a49c96f4f64eb..6d72ee26a441fe3b32943eb137ef0d2fb5a03ef8 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 3cce0cb6303510264feafcd2e8ce42de0d7eaadc..bc754725ca67b605dd23c25e020dea75a805a6e0 100644 (file)
@@ -81,7 +81,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);
 
@@ -219,7 +219,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 521c7c6a23d40a95fe7e81660326af9d259bfdb6..702d4966b3d8e7c9b9fada358be14d9dfd24465a 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));
 
@@ -522,7 +522,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);
@@ -569,16 +569,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);
@@ -595,7 +595,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));
@@ -680,7 +680,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);
@@ -715,7 +715,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);
@@ -762,7 +762,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));
 
@@ -797,7 +797,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));
 
@@ -832,7 +832,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);
@@ -872,7 +872,7 @@ public class NeutronL3AdapterTest {
     @SuppressWarnings("unchecked")
     @Test
     public void testProgramOutboundIpRewriteStage1() throws Exception{
-        Set<String> outboundIpRewriteCache = new HashSet<String>();
+        Set<String> outboundIpRewriteCache = new HashSet<>();
 
         MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "programOutboundIpRewriteStage2", floatingIpClass, Action.class));
 
index 1888003e88a149e10be92e7358eb31c319d052bf..b0628218a19699c640911323eaa86836de67ee4e 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 5a738a6a8d476bffe987171df31c35ab89573177..92e92ea7d45c99c66625c02819e6acf0aede2cd2 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);
-        List<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);
-        List<NeutronNetwork> listNeutronNetwork = new ArrayList<NeutronNetwork>();
+        List<NeutronNetwork> listNeutronNetwork = new ArrayList<>();
         listNeutronNetwork.add(neutronNetwork);
 
         when(neutronNetwork.getProviderSegmentationID()).thenReturn("segId");
index 7ab12eff4d64a7d62d6f5930b6811f460b2534aa..6f4695fb80fbbc78106d78380919dd2f061d9fcb 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);
index c477cb0ee6f0fc6a6c35c7b6a045a4ce0376ac6d..e12e465e8950ae9615f5bc3ab1ee6fd473cff7c8 100644 (file)
@@ -118,7 +118,7 @@ public class OvsdbConnectionInstance implements OvsdbClient {
     public void createTransactInvokers() {
         if (transactInvokers == null) {
             try {
-                transactInvokers = new HashMap<DatabaseSchema,TransactInvoker>();
+                transactInvokers = new HashMap<>();
                 List<String> databases = getDatabases().get();
                 for (String database : databases) {
                     DatabaseSchema dbSchema = getSchema(database).get();
@@ -161,7 +161,7 @@ public class OvsdbConnectionInstance implements OvsdbClient {
 
             // OpenVSwitchPart
             OpenVSwitch ovs = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), OpenVSwitch.class);
-            Map<String, String> externalIdsMap = new HashMap<String, String>();
+            Map<String, String> externalIdsMap = new HashMap<>();
 
             List<OpenvswitchExternalIds> externalIds = this.initialCreateData.getOpenvswitchExternalIds();
 
@@ -188,7 +188,7 @@ public class OvsdbConnectionInstance implements OvsdbClient {
 
             List<OpenvswitchOtherConfigs> otherConfigs = this.initialCreateData.getOpenvswitchOtherConfigs();
             if (otherConfigs != null) {
-                Map<String, String> otherConfigsMap = new HashMap<String, String>();
+                Map<String, String> otherConfigsMap = new HashMap<>();
                 for (OpenvswitchOtherConfigs otherConfig : otherConfigs) {
                     otherConfigsMap.put(otherConfig.getOtherConfigKey(), otherConfig.getOtherConfigValue());
                 }
index 221f9f2eb69e0220eefacd81afccf9746c06286f..8b2859317224fd62ce678a1cc3ce305049f4ea8c 100644 (file)
@@ -176,7 +176,7 @@ public class OvsdbDataChangeListener implements ClusteredDataChangeListener, Aut
     public Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> connectionInstancesFromChanges(
             AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes) {
         Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> result =
-                new HashMap<InstanceIdentifier<Node>,OvsdbConnectionInstance>();
+                new HashMap<>();
         result.putAll(connectionInstancesFromMap(changes.getCreatedData()));
         result.putAll(connectionInstancesFromMap(changes.getUpdatedData()));
         result.putAll(connectionInstancesFromMap(
@@ -188,7 +188,7 @@ public class OvsdbDataChangeListener implements ClusteredDataChangeListener, Aut
             DataObject> map) {
         Preconditions.checkNotNull(map);
         Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> result =
-                new HashMap<InstanceIdentifier<Node>,OvsdbConnectionInstance>();
+                new HashMap<>();
         for ( Entry<InstanceIdentifier<?>, DataObject> created : map.entrySet()) {
             if (created.getValue() instanceof Node) {
                 OvsdbConnectionInstance client = null;
index 86b76407931d4340f3d5be0b8dd53443028f4244..09dba01c1991abb5c6ba403eba047263889d3b10 100644 (file)
@@ -248,7 +248,7 @@ public class SouthboundMapper {
         } catch (SchemaVersionMismatchException e) {
             LOG.warn("protocols not supported by this version of ovsdb", e);
         }
-        List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
+        List<ProtocolEntry> protocolList = new ArrayList<>();
         if (protocols != null && protocols.size() > 0) {
             ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
                     SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
@@ -276,7 +276,7 @@ public class SouthboundMapper {
         LOG.debug("createControllerEntries Bridge: {}\n, updatedControllerRows: {}",
                 bridge, updatedControllerRows);
         final Set<UUID> controllerUUIDs = bridge.getControllerColumn().getData();
-        final List<ControllerEntry> controllerEntries = new ArrayList<ControllerEntry>();
+        final List<ControllerEntry> controllerEntries = new ArrayList<>();
         for (UUID controllerUUID : controllerUUIDs ) {
             final Controller controller = updatedControllerRows.get(controllerUUID);
             addControllerEntries(controllerEntries, controller);
@@ -298,7 +298,7 @@ public class SouthboundMapper {
 
         LOG.debug("createControllerEntries Bridge 2: {}\n, updatedControllerRows: {}",
                 bridgeNode, updatedControllerRows);
-        final List<ControllerEntry> controllerEntriesCreated = new ArrayList<ControllerEntry>();
+        final List<ControllerEntry> controllerEntriesCreated = new ArrayList<>();
         final OvsdbBridgeAugmentation ovsdbBridgeAugmentation =
                 bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
         if (ovsdbBridgeAugmentation == null) {
@@ -386,7 +386,7 @@ public class SouthboundMapper {
         LOG.debug("createManagerEntries OpenVSwitch: {}\n, updatedManagerRows: {}",
                 ovsdbNode, updatedManagerRows);
         final Set<UUID> managerUUIDs = ovsdbNode.getManagerOptionsColumn().getData();
-        final List<ManagerEntry> managerEntries = new ArrayList<ManagerEntry>();
+        final List<ManagerEntry> managerEntries = new ArrayList<>();
         for (UUID managerUUID : managerUUIDs ) {
             final Manager manager = updatedManagerRows.get(managerUUID);
             addManagerEntries(managerEntries, manager);
@@ -408,7 +408,7 @@ public class SouthboundMapper {
 
         LOG.debug("createManagerEntries based on OVSDB Node: {}\n, updatedManagerRows: {}",
                 ovsdbNode, updatedManagerRows);
-        final List<ManagerEntry> managerEntriesCreated = new ArrayList<ManagerEntry>();
+        final List<ManagerEntry> managerEntriesCreated = new ArrayList<>();
         final OvsdbNodeAugmentation ovsdbNodeAugmentation =
                 ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
         if (ovsdbNodeAugmentation == null) {
index d555f8f9f46d40e31ba005da3a40fd6bb7e61830..7622ef47cdf7364886bb93d06b49b0fae48aa31e 100644 (file)
@@ -124,7 +124,7 @@ public class BridgeUpdateCommand extends AbstractTransactCommand {
     private void setOpenDaylightExternalIds(Bridge bridge, InstanceIdentifier<OvsdbBridgeAugmentation> iid,
             OvsdbBridgeAugmentation ovsdbManagedNode) {
         // Set the iid external_id
-        Map<String, String> externalIdMap = new HashMap<String, String>();
+        Map<String, String> externalIdMap = new HashMap<>();
         externalIdMap.put(SouthboundConstants.IID_EXTERNAL_ID_KEY, SouthboundUtil.serializeInstanceIdentifier(iid));
         // Set user provided external ids
         List<BridgeExternalIds> bridgeExternalId = ovsdbManagedNode.getBridgeExternalIds();
@@ -145,7 +145,7 @@ public class BridgeUpdateCommand extends AbstractTransactCommand {
     private void setOpenDaylightOtherConfig(Bridge bridge, OvsdbBridgeAugmentation ovsdbManagedNode) {
         List<BridgeOtherConfigs> bridgeOtherConfig = ovsdbManagedNode.getBridgeOtherConfigs();
         if (bridgeOtherConfig != null) {
-            Map<String, String> otherConfigMap = new HashMap<String, String>();
+            Map<String, String> otherConfigMap = new HashMap<>();
             for (BridgeOtherConfigs otherConf : bridgeOtherConfig) {
                 otherConfigMap.put(otherConf.getBridgeOtherConfigKey(), otherConf.getBridgeOtherConfigValue());
             }
index cc6b7d642ec641a8a45154c606bf7d24872fca1c..5b4acd4c00e5a7884fb23ce1b2cc01e4dfcac074 100644 (file)
@@ -41,7 +41,7 @@ public class DataChangesManagedByOvsdbNodeEvent implements
     private Map<InstanceIdentifier<?>, DataObject> filter(Map<InstanceIdentifier<?>,
             DataObject> data) {
         Map<InstanceIdentifier<?>, DataObject> result
-            = new HashMap<InstanceIdentifier<?>, DataObject>();
+            = new HashMap<>();
         for (Entry<InstanceIdentifier<?>, DataObject> entry: data.entrySet()) {
             if (isManagedBy(entry.getKey())) {
                 result.put(entry.getKey(),entry.getValue());
@@ -76,7 +76,7 @@ public class DataChangesManagedByOvsdbNodeEvent implements
     @Override
     public Set<InstanceIdentifier<?>> getRemovedPaths() {
         if (this.removedPaths == null) {
-            this.removedPaths = new HashSet<InstanceIdentifier<?>>();
+            this.removedPaths = new HashSet<>();
             for (InstanceIdentifier<?> path: event.getRemovedPaths()) {
                 if (isManagedBy(path)) {
                     this.removedPaths.add(path);
index 4d4aa5d0fdf08f097e3c4ab7e320df7816500f92..3db0356abb701be90610b30bdc7b8b81d8e9da32 100644 (file)
@@ -55,7 +55,7 @@ public class OvsdbNodeUpdateCommand implements TransactCommand {
 
             // OpenVSwitchPart
             OpenVSwitch ovs = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), OpenVSwitch.class);
-            Map<String, String> externalIdsMap = new HashMap<String, String>();
+            Map<String, String> externalIdsMap = new HashMap<>();
 
             List<OpenvswitchExternalIds> externalIds = ovsdbNode.getOpenvswitchExternalIds();
 
@@ -82,7 +82,7 @@ public class OvsdbNodeUpdateCommand implements TransactCommand {
 
             List<OpenvswitchOtherConfigs> otherConfigs = ovsdbNode.getOpenvswitchOtherConfigs();
             if (otherConfigs != null) {
-                Map<String, String> otherConfigsMap = new HashMap<String, String>();
+                Map<String, String> otherConfigsMap = new HashMap<>();
                 for (OpenvswitchOtherConfigs otherConfig : otherConfigs) {
                     otherConfigsMap.put(otherConfig.getOtherConfigKey(), otherConfig.getOtherConfigValue());
                 }
index 00f3d5828bd0e446bf95a7bbdaa4f5c9dfc6f0dd..4548fd87db88fb53784dfe2d58dd00e7d0f2e9b7 100644 (file)
@@ -171,7 +171,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
 
         //Configure optional input
         if (terminationPoint.getOptions() != null) {
-            Map<String, String> optionsMap = new HashMap<String, String>();
+            Map<String, String> optionsMap = new HashMap<>();
             for (Options option : terminationPoint.getOptions()) {
                 optionsMap.put(option.getOption(), option.getValue());
             }
@@ -190,7 +190,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
         List<InterfaceExternalIds> interfaceExternalIds =
                 terminationPoint.getInterfaceExternalIds();
         if (interfaceExternalIds != null && !interfaceExternalIds.isEmpty()) {
-            Map<String, String> externalIdsMap = new HashMap<String, String>();
+            Map<String, String> externalIdsMap = new HashMap<>();
             for (InterfaceExternalIds externalId: interfaceExternalIds) {
                 externalIdsMap.put(externalId.getExternalIdKey(), externalId.getExternalIdValue());
             }
@@ -209,7 +209,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
         List<InterfaceOtherConfigs> interfaceOtherConfigs =
                 terminationPoint.getInterfaceOtherConfigs();
         if (interfaceOtherConfigs != null && !interfaceOtherConfigs.isEmpty()) {
-            Map<String, String> otherConfigsMap = new HashMap<String, String>();
+            Map<String, String> otherConfigsMap = new HashMap<>();
             for (InterfaceOtherConfigs interfaceOtherConfig : interfaceOtherConfigs) {
                 otherConfigsMap.put(interfaceOtherConfig.getOtherConfigKey(),
                         interfaceOtherConfig.getOtherConfigValue());
@@ -228,7 +228,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
 
         List<PortExternalIds> portExternalIds = terminationPoint.getPortExternalIds();
         if (portExternalIds != null && !portExternalIds.isEmpty()) {
-            Map<String, String> externalIdsMap = new HashMap<String, String>();
+            Map<String, String> externalIdsMap = new HashMap<>();
             for (PortExternalIds externalId: portExternalIds) {
                 externalIdsMap.put(externalId.getExternalIdKey(), externalId.getExternalIdValue());
             }
@@ -245,7 +245,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
             final Port port) {
 
         if (terminationPoint.getVlanTag() != null) {
-            Set<Long> vlanTag = new HashSet<Long>();
+            Set<Long> vlanTag = new HashSet<>();
             vlanTag.add(terminationPoint.getVlanTag().getValue().longValue());
             port.setTag(vlanTag);
         }
@@ -256,7 +256,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
             final Port port) {
 
         if (terminationPoint.getTrunks() != null && terminationPoint.getTrunks().size() > 0) {
-            Set<Long> portTrunks = new HashSet<Long>();
+            Set<Long> portTrunks = new HashSet<>();
             List<Trunks> modelTrunks = terminationPoint.getTrunks();
             for (Trunks trunk: modelTrunks) {
                 if (trunk.getTrunk() != null) {
@@ -271,7 +271,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
             final OvsdbTerminationPointAugmentation terminationPoint,
             final Port port) {
         if (terminationPoint.getVlanMode() != null) {
-            Set<String> portVlanMode = new HashSet<String>();
+            Set<String> portVlanMode = new HashSet<>();
             VlanMode modelVlanMode = terminationPoint.getVlanMode();
             portVlanMode.add(SouthboundConstants.VLANMODES.values()[modelVlanMode.getIntValue() - 1].getMode());
             port.setVlanMode(portVlanMode);
@@ -284,7 +284,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
         List<PortOtherConfigs> portOtherConfigs =
                 terminationPoint.getPortOtherConfigs();
         if (portOtherConfigs != null && !portOtherConfigs.isEmpty()) {
-            Map<String, String> otherConfigsMap = new HashMap<String, String>();
+            Map<String, String> otherConfigsMap = new HashMap<>();
             for (PortOtherConfigs portOtherConfig : portOtherConfigs) {
                 otherConfigsMap.put(portOtherConfig.getOtherConfigKey(),
                         portOtherConfig.getOtherConfigValue());
index fa2f6d52cd9cb5768a9e4dff06368aca78bc26ec..525ab09c08429b3569c538ad4cfa6511eaaaa9da 100644 (file)
@@ -147,7 +147,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
 
         //Configure optional input
         if (terminationPoint.getOptions() != null) {
-            Map<String, String> optionsMap = new HashMap<String, String>();
+            Map<String, String> optionsMap = new HashMap<>();
             for (Options option : terminationPoint.getOptions()) {
                 optionsMap.put(option.getOption(), option.getValue());
             }
@@ -166,7 +166,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
         List<InterfaceExternalIds> interfaceExternalIds =
                 terminationPoint.getInterfaceExternalIds();
         if (interfaceExternalIds != null && !interfaceExternalIds.isEmpty()) {
-            Map<String, String> externalIdsMap = new HashMap<String, String>();
+            Map<String, String> externalIdsMap = new HashMap<>();
             for (InterfaceExternalIds externalId: interfaceExternalIds) {
                 externalIdsMap.put(externalId.getExternalIdKey(), externalId.getExternalIdValue());
             }
@@ -185,7 +185,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
         List<InterfaceOtherConfigs> interfaceOtherConfigs =
                 terminationPoint.getInterfaceOtherConfigs();
         if (interfaceOtherConfigs != null && !interfaceOtherConfigs.isEmpty()) {
-            Map<String, String> otherConfigsMap = new HashMap<String, String>();
+            Map<String, String> otherConfigsMap = new HashMap<>();
             for (InterfaceOtherConfigs interfaceOtherConfig : interfaceOtherConfigs) {
                 otherConfigsMap.put(interfaceOtherConfig.getOtherConfigKey(),
                         interfaceOtherConfig.getOtherConfigValue());
@@ -204,7 +204,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
 
         List<PortExternalIds> portExternalIds = terminationPoint.getPortExternalIds();
         if (portExternalIds != null && !portExternalIds.isEmpty()) {
-            Map<String, String> externalIdsMap = new HashMap<String, String>();
+            Map<String, String> externalIdsMap = new HashMap<>();
             for (PortExternalIds externalId: portExternalIds) {
                 externalIdsMap.put(externalId.getExternalIdKey(), externalId.getExternalIdValue());
             }
@@ -221,7 +221,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
             final Port port) {
 
         if (terminationPoint.getVlanTag() != null) {
-            Set<Long> vlanTag = new HashSet<Long>();
+            Set<Long> vlanTag = new HashSet<>();
             vlanTag.add(terminationPoint.getVlanTag().getValue().longValue());
             port.setTag(vlanTag);
         }
@@ -232,7 +232,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
             final Port port) {
 
         if (terminationPoint.getTrunks() != null && terminationPoint.getTrunks().size() > 0) {
-            Set<Long> portTrunks = new HashSet<Long>();
+            Set<Long> portTrunks = new HashSet<>();
             List<Trunks> modelTrunks = terminationPoint.getTrunks();
             for (Trunks trunk: modelTrunks) {
                 if (trunk.getTrunk() != null) {
@@ -247,7 +247,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
             final OvsdbTerminationPointAugmentation terminationPoint,
             final Port port) {
         if (terminationPoint.getVlanMode() != null) {
-            Set<String> portVlanMode = new HashSet<String>();
+            Set<String> portVlanMode = new HashSet<>();
             VlanMode modelVlanMode = terminationPoint.getVlanMode();
             portVlanMode.add(SouthboundConstants.VLANMODES.values()[modelVlanMode.getIntValue() - 1].getMode());
             port.setVlanMode(portVlanMode);
@@ -260,7 +260,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
         List<PortOtherConfigs> portOtherConfigs =
                 terminationPoint.getPortOtherConfigs();
         if (portOtherConfigs != null && !portOtherConfigs.isEmpty()) {
-            Map<String, String> otherConfigsMap = new HashMap<String, String>();
+            Map<String, String> otherConfigsMap = new HashMap<>();
             for (PortOtherConfigs portOtherConfig : portOtherConfigs) {
                 otherConfigsMap.put(portOtherConfig.getOtherConfigKey(),
                         portOtherConfig.getOtherConfigValue());
index fccd841692ea945dab493f574213f3b0ebfdc9cb..9bcddbfeaacef5565a79cdca26514e8cab597845 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class TransactCommandAggregator implements TransactCommand {
 
-    private List<TransactCommand> commands = new ArrayList<TransactCommand>();
+    private List<TransactCommand> commands = new ArrayList<>();
     private AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes;
     private BridgeOperationalState operationalState;
 
index 25d875b6631acc39915a37fe08f888843ba9844f..9af3750a7b2e8dd2057031b5bb420ed6350f9f10 100644 (file)
@@ -50,7 +50,7 @@ public class TransactUtils {
     public static Map<InstanceIdentifier<Node>,Node> extractNode(
             Map<InstanceIdentifier<?>, DataObject> changes) {
         Map<InstanceIdentifier<Node>,Node> result
-            = new HashMap<InstanceIdentifier<Node>,Node>();
+            = new HashMap<>();
         if (changes != null && changes.entrySet() != null) {
             for (Entry<InstanceIdentifier<?>, DataObject> created : changes.entrySet()) {
                 if (created.getValue() instanceof Node) {
@@ -99,7 +99,7 @@ public class TransactUtils {
 
     public static <T extends DataObject> Set<InstanceIdentifier<T>> extractRemoved(
             AsyncDataChangeEvent<InstanceIdentifier<?>,DataObject> changes,Class<T> klazz) {
-        Set<InstanceIdentifier<T>> result = new HashSet<InstanceIdentifier<T>>();
+        Set<InstanceIdentifier<T>> result = new HashSet<>();
         if (changes != null && changes.getRemovedPaths() != null) {
             for (InstanceIdentifier<?> iid : changes.getRemovedPaths()) {
                 if (iid.getTargetType().equals(klazz)) {
@@ -121,7 +121,7 @@ public class TransactUtils {
 
     public static <T extends DataObject> Map<InstanceIdentifier<T>,T> extract(
             Map<InstanceIdentifier<?>, DataObject> changes, Class<T> klazz) {
-        Map<InstanceIdentifier<T>,T> result = new HashMap<InstanceIdentifier<T>,T>();
+        Map<InstanceIdentifier<T>,T> result = new HashMap<>();
         if (changes != null && changes.entrySet() != null) {
             for (Entry<InstanceIdentifier<?>, DataObject> created : changes.entrySet()) {
                 if (klazz.isInstance(created.getValue())) {
@@ -141,7 +141,7 @@ public class TransactUtils {
 
     public static List<Insert> extractInsert(TransactionBuilder transaction, GenericTableSchema schema) {
         List<Operation> operations = transaction.getOperations();
-        List<Insert> inserts = new ArrayList<Insert>();
+        List<Insert> inserts = new ArrayList<>();
         for (int count = 0;count < operations.size();count++) {
             Operation operation = operations.get(count);
             if (operation instanceof Insert && operation.getTableSchema().equals(schema)) {
index a11566aca3fecf8e917c37eab3a4176be289456a..067731b7c457c90f2736d034972bc06996e18960 100644 (file)
@@ -68,7 +68,7 @@ public class OvsdbControllerRemovedCommand extends AbstractTransactionCommand {
         Preconditions.checkNotNull(bridgeIid);
         Preconditions.checkNotNull(bridge);
         List<InstanceIdentifier<ControllerEntry>> result =
-                new ArrayList<InstanceIdentifier<ControllerEntry>>();
+                new ArrayList<>();
         Bridge oldBridgeNode = oldBridgeRows.get(bridge.getUuid());
 
         if (oldBridgeNode != null && oldBridgeNode.getControllerColumn() != null) {
index 42aff407d8ef24b8943911742c9eec526477f7f3..6b9af4b3d72fe20e0eb97d28a6a50791c22f0300 100644 (file)
@@ -69,7 +69,7 @@ public class OvsdbManagersRemovedCommand extends AbstractTransactionCommand {
         Preconditions.checkNotNull(openVSwitch);
 
         List<InstanceIdentifier<ManagerEntry>> result =
-                new ArrayList<InstanceIdentifier<ManagerEntry>>();
+                new ArrayList<>();
         OpenVSwitch oldOvsdbNode = oldOpenVSwitchRows.get(openVSwitch.getUuid());
 
         if (oldOvsdbNode != null && oldOvsdbNode.getManagerOptionsColumn() != null) {
index 53b35af72733744716417929e5e702881a929342..c1fece74ca029e523a370b4cad3ab391305765f5 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.ovsdb.southbound.OvsdbConnectionInstance;
 public class OvsdbOperationalCommandAggregator implements TransactionCommand {
 
 
-    private List<TransactionCommand> commands = new ArrayList<TransactionCommand>();
+    private List<TransactionCommand> commands = new ArrayList<>();
 
     public OvsdbOperationalCommandAggregator(OvsdbConnectionInstance key,TableUpdates updates,
             DatabaseSchema dbSchema) {
index 1b0bf926bc3769afc695231d414abdf153f51555..0646f6be05007c11ec3a8085cc884b3cb5ef520d 100644 (file)
@@ -271,7 +271,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
             final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) {
 
         Set<Long> portTrunks = port.getTrunksColumn().getData();
-        List<Trunks> modelTrunks = new ArrayList<Trunks>();
+        List<Trunks> modelTrunks = new ArrayList<>();
         if (!portTrunks.isEmpty()) {
             for (Long trunk: portTrunks) {
                 if (trunk != null) {
@@ -355,7 +355,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
         if (interfaceExternalIds != null && !interfaceExternalIds.isEmpty()) {
             Set<String> externalIdKeys = interfaceExternalIds.keySet();
             List<InterfaceExternalIds> externalIdsList =
-                    new ArrayList<InterfaceExternalIds>();
+                    new ArrayList<>();
             String externalIdValue;
             for (String externalIdKey : externalIdKeys) {
                 externalIdValue = interfaceExternalIds.get(externalIdKey);
@@ -375,7 +375,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
         Map<String, String> portExternalIds = port.getExternalIdsColumn().getData();
         if (portExternalIds != null && !portExternalIds.isEmpty()) {
             Set<String> externalIdKeys = portExternalIds.keySet();
-            List<PortExternalIds> externalIdsList = new ArrayList<PortExternalIds>();
+            List<PortExternalIds> externalIdsList = new ArrayList<>();
             String externalIdValue;
             for (String externalIdKey : externalIdKeys) {
                 externalIdValue = portExternalIds.get(externalIdKey);
@@ -394,7 +394,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
 
         Map<String, String> optionsMap = interf.getOptionsColumn().getData();
         if (optionsMap != null && !optionsMap.isEmpty()) {
-            List<Options> options = new ArrayList<Options>();
+            List<Options> options = new ArrayList<>();
             String optionsValueString;
             OptionsKey optionsKey;
             for (String optionsKeyString : optionsMap.keySet()) {
@@ -415,7 +415,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
 
         Map<String, String> portOtherConfigMap = port.getOtherConfigColumn().getData();
         if (portOtherConfigMap != null && !portOtherConfigMap.isEmpty()) {
-            List<PortOtherConfigs> portOtherConfigs = new ArrayList<PortOtherConfigs>();
+            List<PortOtherConfigs> portOtherConfigs = new ArrayList<>();
             String portOtherConfigValueString;
             for (String portOtherConfigKeyString : portOtherConfigMap.keySet()) {
                 portOtherConfigValueString = portOtherConfigMap.get(portOtherConfigKeyString);
@@ -434,7 +434,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
 
         Map<String, String> interfaceOtherConfigMap = interf.getOtherConfigColumn().getData();
         if (interfaceOtherConfigMap != null && !interfaceOtherConfigMap.isEmpty()) {
-            List<InterfaceOtherConfigs> interfaceOtherConfigs = new ArrayList<InterfaceOtherConfigs>();
+            List<InterfaceOtherConfigs> interfaceOtherConfigs = new ArrayList<>();
             String interfaceOtherConfigValueString;
             for (String interfaceOtherConfigKeyString : interfaceOtherConfigMap.keySet()) {
                 interfaceOtherConfigValueString = interfaceOtherConfigMap.get(interfaceOtherConfigKeyString);
index fdf21997c2ab5b0668b5cbf1966170994edc5cb6..cd0541524775e4a3270de75d97e0ca1b00c36459 100644 (file)
@@ -39,15 +39,15 @@ public class TransactionInvokerImpl implements TransactionInvoker,TransactionCha
     private static final int QUEUE_SIZE = 10000;
     private BindingTransactionChain chain;
     private DataBroker db;
-    private BlockingQueue<TransactionCommand> inputQueue = new LinkedBlockingQueue<TransactionCommand>(QUEUE_SIZE);
+    private BlockingQueue<TransactionCommand> inputQueue = new LinkedBlockingQueue<>(QUEUE_SIZE);
     private BlockingQueue<ReadWriteTransaction> successfulTransactionQueue
-        = new LinkedBlockingQueue<ReadWriteTransaction>(QUEUE_SIZE);
+        = new LinkedBlockingQueue<>(QUEUE_SIZE);
     private BlockingQueue<AsyncTransaction<?, ?>> failedTransactionQueue
-        = new LinkedBlockingQueue<AsyncTransaction<?, ?>>(QUEUE_SIZE);
+        = new LinkedBlockingQueue<>(QUEUE_SIZE);
     private ExecutorService executor;
     private Map<ReadWriteTransaction,TransactionCommand> transactionToCommand
-        = new HashMap<ReadWriteTransaction,TransactionCommand>();
-    private List<ReadWriteTransaction> pendingTransactions = new ArrayList<ReadWriteTransaction>();
+        = new HashMap<>();
+    private List<ReadWriteTransaction> pendingTransactions = new ArrayList<>();
     private final AtomicBoolean runTask = new AtomicBoolean( true );
 
     public TransactionInvokerImpl(DataBroker db) {
@@ -106,7 +106,7 @@ public class TransactionInvokerImpl implements TransactionInvoker,TransactionCha
 
     private List<TransactionCommand> extractResubmitCommands() {
         AsyncTransaction<?, ?> transaction = failedTransactionQueue.poll();
-        List<TransactionCommand> commands = new ArrayList<TransactionCommand>();
+        List<TransactionCommand> commands = new ArrayList<>();
         if (transaction != null) {
             int index = pendingTransactions.lastIndexOf(transaction);
             List<ReadWriteTransaction> transactions =
@@ -122,8 +122,8 @@ public class TransactionInvokerImpl implements TransactionInvoker,TransactionCha
     private void resetTransactionQueue() {
         chain.close();
         chain = db.createTransactionChain(this);
-        pendingTransactions = new ArrayList<ReadWriteTransaction>();
-        transactionToCommand = new HashMap<ReadWriteTransaction,TransactionCommand>();
+        pendingTransactions = new ArrayList<>();
+        transactionToCommand = new HashMap<>();
         failedTransactionQueue.clear();
         successfulTransactionQueue.clear();
     }
@@ -141,7 +141,7 @@ public class TransactionInvokerImpl implements TransactionInvoker,TransactionCha
     }
 
     private List<TransactionCommand> extractCommandsFromQueue() throws InterruptedException {
-        List<TransactionCommand> result = new ArrayList<TransactionCommand>();
+        List<TransactionCommand> result = new ArrayList<>();
         TransactionCommand command = inputQueue.take();
         while (command != null) {
             result.add(command);
index cbfe4c2b6543a4f6396ce106e4068e22201c80dc..1e8710ca3db4b8ff72df21b688e94451c22ed810 100644 (file)
@@ -116,7 +116,7 @@ public class OvsdbConnectionInstanceTest {
         //callback null case
         MemberModifier.field(OvsdbConnectionInstance.class, "callback").set(ovsdbConnectionInstance , null);
         ListenableFuture<List<String>> listenableFuture = mock(ListenableFuture.class);
-        List<String> databases = new ArrayList<String>();
+        List<String> databases = new ArrayList<>();
         databases.add("Open_vSwitch");
         databases.add("");
         doReturn(listenableFuture).when(ovsdbConnectionInstance).getDatabases();
@@ -144,7 +144,7 @@ public class OvsdbConnectionInstanceTest {
         //transactInvokers null case
         MemberModifier.field(OvsdbConnectionInstance.class, "transactInvokers").set(ovsdbConnectionInstance , null);
         ListenableFuture<List<String>> listenableFuture = mock(ListenableFuture.class);
-        List<String> databases = new ArrayList<String>();
+        List<String> databases = new ArrayList<>();
         databases.add("database1");
         databases.add("database2");
         doReturn(listenableFuture).when(ovsdbConnectionInstance).getDatabases();
@@ -167,7 +167,7 @@ public class OvsdbConnectionInstanceTest {
     @SuppressWarnings("unchecked")
     @Test
     public void testMonitorAllTables() throws Exception {
-        Set<String> tables = new HashSet<String>();
+        Set<String> tables = new HashSet<>();
         tables.add("tableName1");
         tables.add("tableName2");
         DatabaseSchema dbSchema = mock(DatabaseSchema.class);
@@ -175,7 +175,7 @@ public class OvsdbConnectionInstanceTest {
         GenericTableSchema tableSchema = mock(GenericTableSchema.class);
         when(dbSchema.table(anyString(), eq(GenericTableSchema.class))).thenReturn(tableSchema);
 
-        Set<String> columns = new HashSet<String>();
+        Set<String> columns = new HashSet<>();
         columns.add("columnName1");
         columns.add("columnName2");
         when(tableSchema.getColumns()).thenReturn(columns);
index ba059fb3394524537e3b90fdde7d6a364e8e9439..3ddc643250de9efcc41ea190658b19da0614db2a 100644 (file)
@@ -137,7 +137,7 @@ public class OvsdbConnectionManagerTest {
         PowerMockito.mockStatic(SouthboundMapper.class);
         when(SouthboundMapper.createConnectionInfo(any(OvsdbClient.class))).thenReturn(key);
 
-        clients = new ConcurrentHashMap<ConnectionInfo,OvsdbConnectionInstance>();
+        clients = new ConcurrentHashMap<>();
         clients.put(key, ovsdbConnectionInstance);
         MemberModifier.field(OvsdbConnectionManager.class, "clients").set(ovsdbConnectionManager, clients);
 
@@ -190,7 +190,7 @@ public class OvsdbConnectionManagerTest {
         ConnectionInfo key2 = mock(ConnectionInfo.class);
         OvsdbConnectionInstance ovsdbConnectionInstance1 = mock(OvsdbConnectionInstance.class);
         OvsdbConnectionInstance ovsdbConnectionInstance2 = mock(OvsdbConnectionInstance.class);
-        clients = new ConcurrentHashMap<ConnectionInfo,OvsdbConnectionInstance>();
+        clients = new ConcurrentHashMap<>();
         clients.put(key1, ovsdbConnectionInstance1);
         clients.put(key2, ovsdbConnectionInstance2);
         MemberModifier.field(OvsdbConnectionManager.class, "clients").set(ovsdbConnectionManager, clients);
@@ -207,7 +207,7 @@ public class OvsdbConnectionManagerTest {
         PowerMockito.mockStatic(SouthboundMapper.class);
         when(SouthboundMapper.suppressLocalIpPort(key)).thenReturn(connectionInfo);
 
-        clients = new ConcurrentHashMap<ConnectionInfo,OvsdbConnectionInstance>();
+        clients = new ConcurrentHashMap<>();
         MemberModifier.field(OvsdbConnectionManager.class, "clients").set(ovsdbConnectionManager, clients);
 
         //Test putConnectionInstance()
@@ -228,7 +228,7 @@ public class OvsdbConnectionManagerTest {
         PowerMockito.mockStatic(SouthboundMapper.class);
         when(SouthboundMapper.suppressLocalIpPort(key)).thenReturn(connectionInfo);
 
-        instanceIdentifiers = new ConcurrentHashMap<ConnectionInfo,InstanceIdentifier<Node>>();
+        instanceIdentifiers = new ConcurrentHashMap<>();
         MemberModifier.field(OvsdbConnectionManager.class, "instanceIdentifiers").set(ovsdbConnectionManager, instanceIdentifiers);
 
         //Test putInstanceIdentifier()
index 469bd723400f1db1e6c3bab2e295dfe83e452245..4858eadfc914cc3c5bdf467aeddfc5ed42e0aad2 100644 (file)
@@ -79,7 +79,7 @@ public class OvsdbDataChangeListenerTest {
     @Test
     public void testOnDataChanged() throws Exception {
         AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
-        Map<InstanceIdentifier<?>, DataObject> map = new HashMap<InstanceIdentifier<?>, DataObject>();
+        Map<InstanceIdentifier<?>, DataObject> map = new HashMap<>();
         InstanceIdentifier<?> iid1 = mock(InstanceIdentifier.class);
         OvsdbNodeAugmentation ovsdbNode = mock(OvsdbNodeAugmentation.class);
         map.put(iid1, ovsdbNode);
@@ -107,7 +107,7 @@ public class OvsdbDataChangeListenerTest {
     @Test
     public void testUpdateData() throws Exception {
         AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
-        Map<InstanceIdentifier<Node>, OvsdbConnectionInstance> map = new HashMap<InstanceIdentifier<Node>, OvsdbConnectionInstance>();
+        Map<InstanceIdentifier<Node>, OvsdbConnectionInstance> map = new HashMap<>();
         InstanceIdentifier<Node> iid = mock(InstanceIdentifier.class);
         OvsdbConnectionInstance connectionInstance = mock(OvsdbConnectionInstance.class);
         map.put(iid, connectionInstance);
@@ -133,8 +133,8 @@ public class OvsdbDataChangeListenerTest {
     @Test
     public void testDisconnectAndConnectAndInit() throws Exception {
         AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
-        Map<InstanceIdentifier<?>, DataObject> originalDataObject = new HashMap<InstanceIdentifier<?>, DataObject>();
-        Set<InstanceIdentifier<?>> iiD = new HashSet<InstanceIdentifier<?>>();
+        Map<InstanceIdentifier<?>, DataObject> originalDataObject = new HashMap<>();
+        Set<InstanceIdentifier<?>> iiD = new HashSet<>();
         InstanceIdentifier instanceIdentifier = mock(InstanceIdentifier.class);
         OvsdbNodeAugmentation ovsdbNode = mock(OvsdbNodeAugmentation.class);
         iiD.add(instanceIdentifier);
@@ -165,7 +165,7 @@ public class OvsdbDataChangeListenerTest {
     @Test
     public void testUpdateConnections() throws Exception {
         AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
-        Map<InstanceIdentifier<?>, DataObject> map = new HashMap<InstanceIdentifier<?>, DataObject>();
+        Map<InstanceIdentifier<?>, DataObject> map = new HashMap<>();
         InstanceIdentifier instanceIdentifier = mock(InstanceIdentifier.class);
         OvsdbNodeAugmentation value = mock(OvsdbNodeAugmentation.class);
         map.put(instanceIdentifier, value);
@@ -188,8 +188,8 @@ public class OvsdbDataChangeListenerTest {
     @Test
     public void testConnectionInstancesFromChanges() throws Exception {
         AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes = mock(AsyncDataChangeEvent.class);
-        Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> testResultMap = new HashMap<InstanceIdentifier<Node>,OvsdbConnectionInstance>();
-        Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> map1 = new HashMap<InstanceIdentifier<Node>,OvsdbConnectionInstance>();
+        Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> testResultMap = new HashMap<>();
+        Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> map1 = new HashMap<>();
         InstanceIdentifier<Node> key1 = mock(InstanceIdentifier.class);
         OvsdbConnectionInstance value1 = mock(OvsdbConnectionInstance.class);
         map1.put(key1, value1);
@@ -207,13 +207,13 @@ public class OvsdbDataChangeListenerTest {
     @Test
     public void testConnectionInstancesFromMap() {
         reset(cm);
-        Map<InstanceIdentifier<?>,DataObject> map = new HashMap<InstanceIdentifier<?>,DataObject>();
+        Map<InstanceIdentifier<?>,DataObject> map = new HashMap<>();
         Node node = mock(Node.class);
         InstanceIdentifier<Node> iid = mock(InstanceIdentifier.class);
         map.put(iid, node);
         OvsdbConnectionInstance client = mock(OvsdbConnectionInstance.class);
 
-        Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> testResultMap = new HashMap<InstanceIdentifier<Node>,OvsdbConnectionInstance>();
+        Map<InstanceIdentifier<Node>,OvsdbConnectionInstance> testResultMap = new HashMap<>();
         testResultMap.put(iid, client);
 
         //bridge and client not null case
@@ -236,7 +236,7 @@ public class OvsdbDataChangeListenerTest {
 
         //bridge null, ovsnode null, and client not null case
         when(node.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(null);
-        List<TerminationPoint> terminationPoint = new ArrayList<TerminationPoint>();
+        List<TerminationPoint> terminationPoint = new ArrayList<>();
         terminationPoint.add(0, mock(TerminationPoint.class));
         when(node.getTerminationPoint()).thenReturn(terminationPoint);
         PowerMockito.mockStatic(SouthboundMapper.class);
index 546e004b55cf23ae3ebdd452ae71d6058fd17493..34238a0248da12e6e321206375b7c4eff362f6d8 100644 (file)
@@ -131,7 +131,7 @@ public class SouthboundMapperTest {
         //when bridge is not empty
         Column<GenericTableSchema, Map<String, String>> column = mock(Column.class);
         when(bridge.getExternalIdsColumn()).thenReturn(column);
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, String> map = new HashMap<>();
         map.put(SouthboundConstants.IID_EXTERNAL_ID_KEY, "IID_EXTERNAL_ID_KEY");
         when(column.getData()).thenReturn(map);
         PowerMockito.mockStatic(SouthboundUtil.class);
@@ -166,7 +166,7 @@ public class SouthboundMapperTest {
         //when controller is not empty
         Column<GenericTableSchema, Map<String, String>> column = mock(Column.class);
         when(controller.getExternalIdsColumn()).thenReturn(column);
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, String> map = new HashMap<>();
         map.put(SouthboundConstants.IID_EXTERNAL_ID_KEY, "IID_EXTERNAL_ID_KEY");
         when(column.getData()).thenReturn(map);
         PowerMockito.mockStatic(SouthboundUtil.class);
@@ -218,7 +218,7 @@ public class SouthboundMapperTest {
 
         Column<GenericTableSchema, Set<String>> column = mock(Column.class);
         when(bridge.getDatapathIdColumn()).thenReturn(column);
-        Set<String> set = new HashSet<String>();
+        Set<String> set = new HashSet<>();
         set.add("dpid");
         when(column.getData()).thenReturn(set);
         assertNotNull(column.getData());
@@ -261,7 +261,7 @@ public class SouthboundMapperTest {
     @Test
     public void testCreateOvsdbBridgeProtocols() {
         OvsdbBridgeAugmentation ovsdbBridgeNode = mock(OvsdbBridgeAugmentation.class);
-        List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
+        List<ProtocolEntry> protocolList = new ArrayList<>();
         ProtocolEntry protocolEntry = mock(ProtocolEntry.class);
         protocolList.add(protocolEntry);
         when(ovsdbBridgeNode.getProtocolEntry()).thenReturn(protocolList);
@@ -271,7 +271,7 @@ public class SouthboundMapperTest {
                 return (Class<? extends OvsdbBridgeProtocolBase>) OvsdbBridgeProtocolOpenflow10.class;
             }
         });
-        Set<String> protocols = new HashSet<String>();
+        Set<String> protocols = new HashSet<>();
         protocols.add("OpenFlow10");
         assertEquals(protocols, SouthboundMapper.createOvsdbBridgeProtocols(ovsdbBridgeNode));
     }
@@ -292,13 +292,13 @@ public class SouthboundMapperTest {
     @Test
     public void testCreateMdsalProtocols() throws Exception {
         Bridge bridge = mock(Bridge.class);
-        Set<String> value = new HashSet<String>();
+        Set<String> value = new HashSet<>();
         value.add("OpenFlow10");
         Column<GenericTableSchema, Set<String>> column = mock(Column.class);
         when(bridge.getProtocolsColumn()).thenReturn(column);
         when(column.getData()).thenReturn(value);
 
-        List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
+        List<ProtocolEntry> protocolList = new ArrayList<>();
         ProtocolEntry protoEntry = mock(ProtocolEntry.class);
         ProtocolEntryBuilder protocolEntryBuilder = mock(ProtocolEntryBuilder.class);
         PowerMockito.whenNew(ProtocolEntryBuilder.class).withNoArguments().thenReturn(protocolEntryBuilder);
@@ -312,16 +312,16 @@ public class SouthboundMapperTest {
     @Test
     public void testCreateControllerEntries() throws Exception {
         Bridge bridge = mock(Bridge.class);
-        Map<UUID, Controller> updatedControllerRows = new HashMap<UUID, Controller>();
+        Map<UUID, Controller> updatedControllerRows = new HashMap<>();
         Column<GenericTableSchema, Set<UUID>> column = mock(Column.class);
         when(bridge.getControllerColumn()).thenReturn(column);
-        Set<UUID> controllerUUIDs = new HashSet<UUID>();
+        Set<UUID> controllerUUIDs = new HashSet<>();
         UUID uuid = mock(UUID.class);
         controllerUUIDs.add(uuid);
         Controller controller = mock(Controller.class);
         updatedControllerRows.put(uuid, controller);
         when(column.getData()).thenReturn(controllerUUIDs);
-        List<ControllerEntry> controllerEntries = new ArrayList<ControllerEntry>();
+        List<ControllerEntry> controllerEntries = new ArrayList<>();
         ControllerEntry controllerEntry = mock(ControllerEntry.class);
         controllerEntries.add(controllerEntry);
 
@@ -356,11 +356,11 @@ public class SouthboundMapperTest {
     public void testCreateOvsdbController() throws Exception {
         OvsdbBridgeAugmentation omn = mock(OvsdbBridgeAugmentation.class);
         DatabaseSchema dbSchema = mock(DatabaseSchema.class);
-        List<ControllerEntry> controllerEntries = new ArrayList<ControllerEntry>();
+        List<ControllerEntry> controllerEntries = new ArrayList<>();
         ControllerEntry controllerEntry = mock(ControllerEntry.class);
         controllerEntries.add(controllerEntry);
         when(omn.getControllerEntry()).thenReturn(controllerEntries);
-        Map<UUID,Controller> controllerMap = new HashMap<UUID,Controller>();
+        Map<UUID,Controller> controllerMap = new HashMap<>();
         PowerMockito.mockStatic(TyperUtils.class);
         Controller controller = mock(Controller.class);
         PowerMockito.when(TyperUtils.getTypedRowWrapper(any(DatabaseSchema.class), eq(Controller.class))).thenReturn(controller);
@@ -412,8 +412,8 @@ public class SouthboundMapperTest {
     @Test
     public void testCreateManagerEntries() throws Exception {
         OpenVSwitch ovsdbNode = mock(OpenVSwitch.class);
-        Map<UUID, Manager> updatedManagerRows = new HashMap<UUID, Manager>();
-        Set<UUID> managerUUIDs = new HashSet<UUID>();
+        Map<UUID, Manager> updatedManagerRows = new HashMap<>();
+        Set<UUID> managerUUIDs = new HashSet<>();
         UUID managerUUID = mock(UUID.class);
         Manager manager = mock(Manager.class);
         managerUUIDs.add(managerUUID);
@@ -421,7 +421,7 @@ public class SouthboundMapperTest {
         Column<GenericTableSchema, Set<UUID>> column = mock(Column.class);
         when(ovsdbNode.getManagerOptionsColumn()).thenReturn(column);
         when(column.getData()).thenReturn(managerUUIDs);
-        List<ManagerEntry> managerEntries = new ArrayList<ManagerEntry>();
+        List<ManagerEntry> managerEntries = new ArrayList<>();
         ManagerEntry managerEntry = mock(ManagerEntry.class);
         managerEntries.add(managerEntry);
 
@@ -432,7 +432,7 @@ public class SouthboundMapperTest {
 
         Column<GenericTableSchema, Map<String, String>> statusColumn = mock(Column.class);
         when(manager.getStatusColumn()).thenReturn(statusColumn);
-        Map<String, String> statusAttributeMap = new HashMap<String, String>();
+        Map<String, String> statusAttributeMap = new HashMap<>();
         when(statusColumn.getData()).thenReturn(statusAttributeMap);
         String numberOfConnectionValueStr = "999";
 
@@ -462,12 +462,12 @@ public class SouthboundMapperTest {
     @Test
     public void testCreateManagerEntries1() throws Exception {
         Node ovsdbNode = mock(Node.class);
-        Map<Uri, Manager> updatedManagerRows = new HashMap<Uri, Manager>();
+        Map<Uri, Manager> updatedManagerRows = new HashMap<>();
         Uri uri = mock(Uri.class);
         Manager manager = mock(Manager.class);
         updatedManagerRows.put(uri, manager);
 
-        List<ManagerEntry> managerEntriesCreated = new ArrayList<ManagerEntry>();
+        List<ManagerEntry> managerEntriesCreated = new ArrayList<>();
 
         //ovsdbNodeAugmentation is null
         when(ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(null);
@@ -477,7 +477,7 @@ public class SouthboundMapperTest {
         OvsdbNodeAugmentation ovsdbNodeAugmentation = mock(OvsdbNodeAugmentation.class);
         when(ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(ovsdbNodeAugmentation);
 
-        List<ManagerEntry> managerEntries = new ArrayList<ManagerEntry>();
+        List<ManagerEntry> managerEntries = new ArrayList<>();
         ManagerEntry managerEntry = mock(ManagerEntry.class);
         managerEntries.add(managerEntry);
         when(ovsdbNodeAugmentation.getManagerEntry()).thenReturn(managerEntries);
@@ -490,7 +490,7 @@ public class SouthboundMapperTest {
 
         Column<GenericTableSchema, Map<String, String>> statusColumn = mock(Column.class);
         when(manager.getStatusColumn()).thenReturn(statusColumn);
-        Map<String, String> statusAttributeMap = new HashMap<String, String>();
+        Map<String, String> statusAttributeMap = new HashMap<>();
         when(statusColumn.getData()).thenReturn(statusAttributeMap);
         String numberOfConnectionValueStr = "999";
 
index 46726c636ec096f2448ad9f4fe6ebeb589b79908..e12ff537a4375e0f488b2b7c686963afa0a8d238 100644 (file)
@@ -101,7 +101,7 @@ public class BridgeOperationalStateTest {
         Node node = mock(Node.class);
         Optional<Node> optNode = mock(Optional.class);
         TerminationPoint termPnt = mock(TerminationPoint.class);
-        List<TerminationPoint> termPntList = new ArrayList<TerminationPoint>();
+        List<TerminationPoint> termPntList = new ArrayList<>();
         termPntList.add(termPnt);
         TerminationPointKey termPntKey = mock(TerminationPointKey.class);
 
index e87f55ac21df3d7fc30b4043aceb3d72cd8aa91d..d1870fdf49b260a65ea3f0dd08009bc9c37d3bc3 100644 (file)
@@ -36,7 +36,7 @@ import org.powermock.reflect.Whitebox;
 @RunWith(PowerMockRunner.class)
 public class TransactCommandAggregatorTest {
     private static final int NUMBER_OF_COMMANDS = 11;
-    private List<TransactCommand> commands = new ArrayList<TransactCommand>();
+    private List<TransactCommand> commands = new ArrayList<>();
     private TransactCommandAggregator transactCommandAggregator;
     @Mock private AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes;
     @Mock private BridgeOperationalState operationalState;
index 8f5c7c9366fcdd1a39d8d0733b92aae3e7eeea21..0078b117ee034df35899760dfb102057fa68b0ca 100644 (file)
@@ -99,7 +99,7 @@ public class TransactUtilsTest {
         PowerMockito.suppress(MemberMatcher.method(TransactUtils.class, "extractUpdated", AsyncDataChangeEvent.class, Class.class));
         PowerMockito.when(TransactUtils.extractUpdated(any(AsyncDataChangeEvent.class),eq(DataObject.class))).thenReturn(result);
 
-        Map<InstanceIdentifier<DataObject>, DataObject> map = new HashMap<InstanceIdentifier<DataObject>, DataObject>();
+        Map<InstanceIdentifier<DataObject>, DataObject> map = new HashMap<>();
         InstanceIdentifier<DataObject> iid = mock(InstanceIdentifier.class);
         DataObject db = mock(DataObject.class);
         map.put(iid, db);
@@ -121,7 +121,7 @@ public class TransactUtilsTest {
         PowerMockito.suppress(MemberMatcher.method(TransactUtils.class, "extractCreatedOrUpdated", AsyncDataChangeEvent.class, Class.class));
         PowerMockito.when(TransactUtils.extractCreatedOrUpdated(any(AsyncDataChangeEvent.class),eq(DataObject.class))).thenReturn(result);
 
-        Map<InstanceIdentifier<DataObject>, DataObject> map = new HashMap<InstanceIdentifier<DataObject>, DataObject>();
+        Map<InstanceIdentifier<DataObject>, DataObject> map = new HashMap<>();
         InstanceIdentifier<DataObject> iid = mock(InstanceIdentifier.class);
         DataObject db = mock(DataObject.class);
         map.put(iid, db);
@@ -182,7 +182,7 @@ public class TransactUtilsTest {
         TransactionBuilder transaction = mock(TransactionBuilder.class);
         GenericTableSchema schema = mock(GenericTableSchema.class);
 
-        List<Operation> operations = new ArrayList<Operation>();
+        List<Operation> operations = new ArrayList<>();
         Operation operation = mock(Insert.class);
         operations.add(operation);
         when(transaction.getOperations()).thenReturn(operations);
index 8a9f4372e9a303accfea7fe68e2b6bac9bc56e7e..211f3800ecee5b80af88d99f0355a488d90322fb 100644 (file)
@@ -87,12 +87,12 @@ public class OpenVSwitchUpdateCommandTest {
     @Test
     public void testExecute() throws Exception {
         PowerMockito.mockStatic(TyperUtils.class);
-        Map<UUID, OpenVSwitch> updatedOpenVSwitchRows = new HashMap<UUID, OpenVSwitch>();
+        Map<UUID, OpenVSwitch> updatedOpenVSwitchRows = new HashMap<>();
         UUID uuid = mock(UUID.class);
         OpenVSwitch ovs = mock(OpenVSwitch.class);
         updatedOpenVSwitchRows.put(uuid, ovs);
         when(TyperUtils.extractRowsUpdated(eq(OpenVSwitch.class), any(TableUpdates.class), any(DatabaseSchema.class))).thenReturn(updatedOpenVSwitchRows);
-        Map<UUID, OpenVSwitch> deletedOpenVSwitchRows = new HashMap<UUID, OpenVSwitch>();
+        Map<UUID, OpenVSwitch> deletedOpenVSwitchRows = new HashMap<>();
         OpenVSwitch ovs1 = mock(OpenVSwitch.class);
 
         deletedOpenVSwitchRows.put(uuid, ovs1);
@@ -104,7 +104,7 @@ public class OpenVSwitchUpdateCommandTest {
 
         //Test getInstanceIdentifier(): case 1: ovs.getExternalIdsColumn().getData().containsKey(SouthboundConstants.IID_EXTERNAL_ID_KEY)) == true
         Column<GenericTableSchema, Map<String, String>> column = mock(Column.class);
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, String> map = new HashMap<>();
         map.put(SouthboundConstants.IID_EXTERNAL_ID_KEY, "iidString");
         when(ovs.getExternalIdsColumn()).thenReturn(column);
         when(column.getData()).thenReturn(map);
@@ -164,7 +164,7 @@ public class OpenVSwitchUpdateCommandTest {
 
         Column<GenericTableSchema, Map<String, String>> column = mock(Column.class);
         when(openVSwitch.getOtherConfigColumn()).thenReturn(column);
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, String> map = new HashMap<>();
         when(column.getData()).thenReturn(map);
         when(oldEntry.getOtherConfigColumn()).thenReturn(column);
         MemberModifier.suppress(MemberMatcher.method(OpenVSwitchUpdateCommand.class, "removeOldConfigs", ReadWriteTransaction.class, Map.class, OpenVSwitch.class));
@@ -179,7 +179,7 @@ public class OpenVSwitchUpdateCommandTest {
     @Test
     public void testRemoveOldConfigs() throws Exception {
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
-        Map<String, String> oldOtherConfigs = new HashMap<String, String>();
+        Map<String, String> oldOtherConfigs = new HashMap<>();
         oldOtherConfigs.put("OpenvswitchOtherConfigsKey", "OpenvswitchOtherConfigsValue");
         OpenVSwitch ovs = mock(OpenVSwitch.class);
         doNothing().when(transaction).delete(any(LogicalDatastoreType.class), any(KeyedInstanceIdentifier.class));
@@ -195,7 +195,7 @@ public class OpenVSwitchUpdateCommandTest {
     @Test
     public void testSetNewOtherConfigs() throws Exception {
         OvsdbNodeAugmentationBuilder ovsdbNodeBuilder = mock(OvsdbNodeAugmentationBuilder.class);
-        Map<String, String> otherConfigs = new HashMap<String, String>();
+        Map<String, String> otherConfigs = new HashMap<>();
         otherConfigs.put("otherConfigKey", "otherConfigValue");
 
         OpenvswitchOtherConfigsBuilder openvswitchOtherConfigsBuilder = mock(OpenvswitchOtherConfigsBuilder.class);
@@ -221,7 +221,7 @@ public class OpenVSwitchUpdateCommandTest {
 
         Column<GenericTableSchema, Map<String, String>> column = mock(Column.class);
         when(openVSwitch.getExternalIdsColumn()).thenReturn(column);
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, String> map = new HashMap<>();
         when(column.getData()).thenReturn(map);
         when(oldEntry.getExternalIdsColumn()).thenReturn(column);
         MemberModifier.suppress(MemberMatcher.method(OpenVSwitchUpdateCommand.class, "removeExternalIds", ReadWriteTransaction.class, Map.class, OpenVSwitch.class));
@@ -236,7 +236,7 @@ public class OpenVSwitchUpdateCommandTest {
     @Test
     public void testRemoveExternalIds() throws Exception {
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
-        Map<String, String> oldExternalIds = new HashMap<String, String>();
+        Map<String, String> oldExternalIds = new HashMap<>();
         oldExternalIds.put("OpenvswitchExternalIdKey", "OpenvswitchExternalIdValue");
         OpenVSwitch ovs = mock(OpenVSwitch.class);
         doNothing().when(transaction).delete(any(LogicalDatastoreType.class), any(KeyedInstanceIdentifier.class));
@@ -252,7 +252,7 @@ public class OpenVSwitchUpdateCommandTest {
     @Test
     public void testSetNewExternalIds() throws Exception {
         OvsdbNodeAugmentationBuilder ovsdbNodeBuilder = mock(OvsdbNodeAugmentationBuilder.class);
-        Map<String, String> externalIds = new HashMap<String, String>();
+        Map<String, String> externalIds = new HashMap<>();
         externalIds.put("externalIdsKey", "externalIdsValue");
 
         OpenvswitchExternalIdsBuilder openvswitchExternalIdsBuilder = mock(OpenvswitchExternalIdsBuilder.class);
@@ -276,7 +276,7 @@ public class OpenVSwitchUpdateCommandTest {
 
         Column<GenericTableSchema, Set<String>> column = mock(Column.class);
         when(openVSwitch.getIfaceTypesColumn()).thenReturn(column );
-        Set<String> set = new HashSet<String>();
+        Set<String> set = new HashSet<>();
         set.add("dpdk");
         set.add("dpdkr");
         set.add("dpdkvhostuser");
@@ -318,7 +318,7 @@ public class OpenVSwitchUpdateCommandTest {
         OpenVSwitch openVSwitch = mock(OpenVSwitch.class);
         Column<GenericTableSchema, Set<String>> column = mock(Column.class);
         when(openVSwitch.getDatapathTypesColumn()).thenReturn(column );
-        Set<String> set = new HashSet<String>();
+        Set<String> set = new HashSet<>();
         set.add("netdev");
         set.add("system");
         when(column.getData()).thenReturn(set);
@@ -348,7 +348,7 @@ public class OpenVSwitchUpdateCommandTest {
         OpenVSwitch openVSwitch = mock(OpenVSwitch.class);
         Column<GenericTableSchema, Set<String>> column = mock(Column.class);
         when(openVSwitch.getOvsVersionColumn()).thenReturn(column);
-        Set<String> set = new HashSet<String>();
+        Set<String> set = new HashSet<>();
         set.add("v2.3.0");
         when(column.getData()).thenReturn(set);
         when(ovsdbNodeBuilder.setOvsVersion(anyString())).thenReturn(ovsdbNodeBuilder);
index faa2329269e40c111b6c7112c082bda36453095e..64aee99d98b9aeabaed7d16cbfae2db710738e14 100644 (file)
@@ -64,7 +64,7 @@ public class OvsdbBridgeRemovedCommandTest {
         when(ovsdbBridgeRemovedCommand.getDbSchema()).thenReturn(mock(DatabaseSchema.class));
 
         PowerMockito.mockStatic(TyperUtils.class);
-        Map<UUID, Bridge> map = new HashMap<UUID, Bridge>();
+        Map<UUID, Bridge> map = new HashMap<>();
         when(TyperUtils.extractRowsRemoved(eq(Bridge.class), any(TableUpdates.class), any(DatabaseSchema.class))).thenReturn(map);
 
         ovsdbBridgeRemovedCommand.execute(transaction);
index 36623770d61d2fd4e8c91e1423b98895d4f69b4c..a4c2efae8353aeb89de4a3655f57b53b51922509 100644 (file)
@@ -90,8 +90,8 @@ import com.google.common.net.InetAddresses;
 @PrepareForTest({TyperUtils.class, OvsdbBridgeUpdateCommand.class, SouthboundUtil.class, InstanceIdentifier.class, SouthboundMapper.class, InetAddresses.class, NumberUtils.class, NetworkInterface.class})
 @RunWith(PowerMockRunner.class)
 public class OvsdbBridgeUpdateCommandTest {
-    private Map<UUID,Bridge> updatedBridgeRows = new HashMap<UUID,Bridge>();
-    private Map<UUID, Bridge> oldBridgeRows = new HashMap<UUID,Bridge>();
+    private Map<UUID,Bridge> updatedBridgeRows = new HashMap<>();
+    private Map<UUID, Bridge> oldBridgeRows = new HashMap<>();
     private OvsdbBridgeUpdateCommand ovsdbBridgeUpdateCommand;
 
     @Before
@@ -153,7 +153,7 @@ public class OvsdbBridgeUpdateCommandTest {
     @Test
     public void testDeleteEntries() throws Exception {
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
-        List<InstanceIdentifier<DataObject>> entryIids = new ArrayList<InstanceIdentifier<DataObject>>();
+        List<InstanceIdentifier<DataObject>> entryIids = new ArrayList<>();
         InstanceIdentifier<DataObject> iid = mock(InstanceIdentifier.class);
         entryIids.add(iid);
         doNothing().when(transaction).delete(any(LogicalDatastoreType.class), (InstanceIdentifier<?>) any(List.class));
@@ -172,7 +172,7 @@ public class OvsdbBridgeUpdateCommandTest {
         when(bridge.getUuid()).thenReturn(uuid);
         MemberModifier.field(OvsdbBridgeUpdateCommand.class, "oldBridgeRows").set(ovsdbBridgeUpdateCommand, oldBridgeRows);
         Column<GenericTableSchema, Map<String, String>> column = mock(Column.class);
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, String> map = new HashMap<>();
         map.put("key", "value");
         when(column.getData()).thenReturn(map);
 
@@ -193,7 +193,7 @@ public class OvsdbBridgeUpdateCommandTest {
 
         //test protocolEntriesToRemove()
         Column<GenericTableSchema, Set<String>> column1 = mock(Column.class);
-        Set<String> set = new HashSet<String>();
+        Set<String> set = new HashSet<>();
         set.add("element");
         when(column1.getData()).thenReturn(set);
         when(oldBridge.getProtocolsColumn()).thenReturn(column1);
@@ -319,7 +319,7 @@ public class OvsdbBridgeUpdateCommandTest {
         Bridge bridge = mock(Bridge.class);
         Column<GenericTableSchema, Set<String>> column = mock(Column.class);
         when(bridge.getFailModeColumn()).thenReturn(column);
-        Set<String> set = new HashSet<String>();
+        Set<String> set = new HashSet<>();
         set.add("standalone");
         when(column.getData()).thenReturn(set);
         when(ovsdbBridgeAugmentationBuilder.setFailMode(OvsdbFailModeStandalone.class)).thenReturn(ovsdbBridgeAugmentationBuilder);
@@ -335,7 +335,7 @@ public class OvsdbBridgeUpdateCommandTest {
         Bridge bridge = mock(Bridge.class);
         Column<GenericTableSchema, Map<String, String>> column = mock(Column.class);
         when(bridge.getOtherConfigColumn()).thenReturn(column);
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, String> map = new HashMap<>();
         map.put("key", "value");
         when(column.getData()).thenReturn(map);
 
@@ -359,7 +359,7 @@ public class OvsdbBridgeUpdateCommandTest {
         Bridge bridge = mock(Bridge.class);
         Column<GenericTableSchema, Map<String, String>> column = mock(Column.class);
         when(bridge.getExternalIdsColumn()).thenReturn(column);
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, String> map = new HashMap<>();
         map.put("key", "value");
         when(column.getData()).thenReturn(map);
 
@@ -384,7 +384,7 @@ public class OvsdbBridgeUpdateCommandTest {
         PowerMockito.mockStatic(SouthboundMapper.class);
 
         //Test setProtocol()
-        List<ProtocolEntry> listProtocolEntry = new ArrayList<ProtocolEntry>();
+        List<ProtocolEntry> listProtocolEntry = new ArrayList<>();
         listProtocolEntry.add(mock(ProtocolEntry.class));
         when(SouthboundMapper.createMdsalProtocols(any(Bridge.class))).thenReturn(listProtocolEntry);
         when(ovsdbBridgeAugmentationBuilder.setProtocolEntry(any(List.class))).thenReturn(ovsdbBridgeAugmentationBuilder);
@@ -407,13 +407,13 @@ public class OvsdbBridgeUpdateCommandTest {
         Bridge bridge = mock(Bridge.class);
         PowerMockito.mockStatic(SouthboundMapper.class);
 
-        Map<UUID, Controller> updatedControllerRows = new HashMap<UUID, Controller>();
+        Map<UUID, Controller> updatedControllerRows = new HashMap<>();
         when(ovsdbBridgeUpdateCommand.getUpdates()).thenReturn(mock(TableUpdates.class));
         when(ovsdbBridgeUpdateCommand.getDbSchema()).thenReturn(mock(DatabaseSchema.class));
         PowerMockito.mockStatic(TyperUtils.class);
         when(TyperUtils.extractRowsUpdated(eq(Controller.class), any(TableUpdates.class), any(DatabaseSchema.class))).thenReturn(updatedControllerRows);
 
-        List<ControllerEntry> controllerEntryList = new ArrayList<ControllerEntry>();
+        List<ControllerEntry> controllerEntryList = new ArrayList<>();
         ControllerEntry controllerEntry = mock(ControllerEntry.class);
         controllerEntryList.add(controllerEntry);
         when(SouthboundMapper.createControllerEntries(any(Bridge.class), any(Map.class))).thenReturn(controllerEntryList);
index 22a28bfec92dc548dd8c12e44ae113d80cfd4ef5..762a2d88af141e36ac72a9b6e2ab3bb76d5ecfbc 100644 (file)
@@ -74,7 +74,7 @@ public class OvsdbControllerRemovedCommandTest {
     @Test
     public void testExecute() throws Exception {
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
-        updatedBridgeRows = new HashMap<UUID, Bridge>();
+        updatedBridgeRows = new HashMap<>();
         UUID uuid = mock(UUID.class);
         Bridge bridge = mock(Bridge.class);
         updatedBridgeRows.put(uuid, bridge);
@@ -92,7 +92,7 @@ public class OvsdbControllerRemovedCommandTest {
     @Test
     public void testDeleteControllers() throws Exception {
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
-        List<InstanceIdentifier<ControllerEntry>> controllerEntryIids = new ArrayList<InstanceIdentifier<ControllerEntry>>();
+        List<InstanceIdentifier<ControllerEntry>> controllerEntryIids = new ArrayList<>();
 
         doNothing().when(transaction).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         Whitebox.invokeMethod(ovsdbControllerRemovedCommand, "deleteControllers", transaction, controllerEntryIids);
@@ -112,12 +112,12 @@ public class OvsdbControllerRemovedCommandTest {
 
         UUID uuid = mock(UUID.class);
         Bridge oldBridgeNode = mock(Bridge.class);
-        oldBridgeRows = new HashMap<UUID, Bridge>();
+        oldBridgeRows = new HashMap<>();
         oldBridgeRows.put(uuid, oldBridgeNode);
         when(bridge.getUuid()).thenReturn(uuid);
         MemberModifier.field(OvsdbControllerRemovedCommand.class, "oldBridgeRows").set(ovsdbControllerRemovedCommand, oldBridgeRows);
         Column<GenericTableSchema, Set<UUID>> column = mock(Column.class);
-        Set<UUID> set = new HashSet<UUID>();
+        Set<UUID> set = new HashSet<>();
         UUID controllerUuid = mock(UUID.class);
         set.add(controllerUuid);
         when(column.getData()).thenReturn(set);
index a0b5b934163aa170b7d58d655d384065191426df..3e66096de5cb677d9b26d1b495581a420e005f3f 100644 (file)
@@ -86,7 +86,7 @@ public class OvsdbControllerUpdateCommandTest {
     @Test
     public void testExecute() throws Exception {
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
-        updatedControllerRows = new HashMap<UUID, Controller>();
+        updatedControllerRows = new HashMap<>();
         updatedControllerRows.put(mock(UUID.class), mock(Controller.class));
         MemberModifier.field(OvsdbControllerUpdateCommand.class, "updatedControllerRows").set(ovsdbControllerUpdateCommand, updatedControllerRows);
         MemberModifier.suppress(MemberMatcher.method(OvsdbControllerUpdateCommand.class, "updateController", ReadWriteTransaction.class, Map.class, Map.class));
@@ -97,7 +97,7 @@ public class OvsdbControllerUpdateCommandTest {
         PowerMockito.verifyPrivate(ovsdbControllerUpdateCommand).invoke("updateController", any(ReadWriteTransaction.class), any(Map.class));
 
         //updatedBridgeRows not null case
-        updatedBridgeRows = new HashMap<UUID, Bridge>();
+        updatedBridgeRows = new HashMap<>();
         updatedBridgeRows.put(mock(UUID.class), mock(Bridge.class));
         MemberModifier.field(OvsdbControllerUpdateCommand.class, "updatedBridgeRows").set(ovsdbControllerUpdateCommand, updatedBridgeRows);
     }
@@ -112,7 +112,7 @@ public class OvsdbControllerUpdateCommandTest {
         updatedBridgeRows.put(mock(UUID.class), bridge);
 
         PowerMockito.mockStatic(SouthboundMapper.class);
-        List<ControllerEntry> controllerEntries = new ArrayList<ControllerEntry>();
+        List<ControllerEntry> controllerEntries = new ArrayList<>();
         controllerEntries.add(mock(ControllerEntry.class));
         when(SouthboundMapper.createControllerEntries(any(Bridge.class), any(Map.class))).thenReturn(controllerEntries);
         Column<GenericTableSchema, String> column = mock(Column.class);
index aabf249594baa62ab3681756e08756db5bf92bcb..24153e33e8b97b98c7c93c61eadb84229b687810 100644 (file)
@@ -80,7 +80,7 @@ public class OvsdbManagersRemovedCommandTest {
     @Test
     public void testExecute() throws Exception {
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
-        updatedOpenVSwitchRows = new HashMap<UUID, OpenVSwitch>();
+        updatedOpenVSwitchRows = new HashMap<>();
         UUID uuid = mock(UUID.class);
         OpenVSwitch openVSwitch = mock(OpenVSwitch.class);
         updatedOpenVSwitchRows.put(uuid, openVSwitch);
@@ -101,7 +101,7 @@ public class OvsdbManagersRemovedCommandTest {
     @Test
     public void testDeleteManagers() throws Exception {
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
-        List<InstanceIdentifier<ManagerEntry>> managerEntryIids = new ArrayList<InstanceIdentifier<ManagerEntry>>();
+        List<InstanceIdentifier<ManagerEntry>> managerEntryIids = new ArrayList<>();
         managerEntryIids.add(mock(InstanceIdentifier.class));
         doNothing().when(transaction).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         Whitebox.invokeMethod(ovsdbManagersRemovedCommand, "deleteManagers", transaction, managerEntryIids);
@@ -116,12 +116,12 @@ public class OvsdbManagersRemovedCommandTest {
 
         UUID uuid = mock(UUID.class);
         OpenVSwitch oldOvsdbNode = mock(OpenVSwitch.class);
-        oldOpenVSwitchRows = new HashMap<UUID, OpenVSwitch>();
+        oldOpenVSwitchRows = new HashMap<>();
         oldOpenVSwitchRows.put(uuid, oldOvsdbNode);
         when(openVSwitch.getUuid()).thenReturn(uuid);
         MemberModifier.field(OvsdbManagersRemovedCommand.class, "oldOpenVSwitchRows").set(ovsdbManagersRemovedCommand, oldOpenVSwitchRows);
         Column<GenericTableSchema, Set<UUID>> column = mock(Column.class);
-        Set<UUID> set = new HashSet<UUID>();
+        Set<UUID> set = new HashSet<>();
         UUID controllerUuid = mock(UUID.class);
         set.add(controllerUuid);
         when(column.getData()).thenReturn(set);
@@ -138,7 +138,7 @@ public class OvsdbManagersRemovedCommandTest {
     public void testCheckIfManagerPresentInUpdatedManagersList() throws Exception {
         Manager removedManager = mock(Manager.class);
         Manager updatedManager = mock(Manager.class);
-        updatedManagerRows = new HashMap<UUID, Manager>();
+        updatedManagerRows = new HashMap<>();
         UUID uuid = mock(UUID.class);
         updatedManagerRows.put(uuid, updatedManager);
         MemberModifier.field(OvsdbManagersRemovedCommand.class, "updatedManagerRows").set(ovsdbManagersRemovedCommand, updatedManagerRows);
index 7ffeb5270a1000344b4fb5a604d3a0dad9abaadf..ee3cedff2b535081b66fe3acaf9697eb23fd7397 100644 (file)
@@ -82,13 +82,13 @@ public class OvsdbManagersUpdateCommandTest {
     @Test
     public void testExecute() throws Exception {
         ReadWriteTransaction transaction= mock(ReadWriteTransaction.class);
-        updatedManagerRows = new HashMap<UUID, Manager>();
+        updatedManagerRows = new HashMap<>();
         updatedManagerRows.put(mock(UUID.class), mock(Manager.class));
         MemberModifier.field(OvsdbManagersUpdateCommand.class, "updatedManagerRows").set(ovsdbManagersUpdateCommand, updatedManagerRows);
         Map<Uri, Manager> updatedManagerRowsWithUri = new HashMap<>();
         PowerMockito.doReturn(updatedManagerRowsWithUri).when(ovsdbManagersUpdateCommand, "getUriManagerMap", any(Map.class));
 
-        updatedOpenVSwitchRows = new HashMap<UUID, OpenVSwitch>();
+        updatedOpenVSwitchRows = new HashMap<>();
         updatedOpenVSwitchRows.put(mock(UUID.class), mock(OpenVSwitch.class));
         MemberModifier.field(OvsdbManagersUpdateCommand.class, "updatedOpenVSwitchRows").set(ovsdbManagersUpdateCommand, updatedOpenVSwitchRows);
 
@@ -110,7 +110,7 @@ public class OvsdbManagersUpdateCommandTest {
         updatedOpenVSwitchRows.put(mock(UUID.class), openVSwitch);
 
         PowerMockito.mockStatic(SouthboundMapper.class);
-        List<ManagerEntry> managerEntries = new ArrayList<ManagerEntry>();
+        List<ManagerEntry> managerEntries = new ArrayList<>();
         managerEntries.add(mock(ManagerEntry.class));
         when(SouthboundMapper.createManagerEntries(any(OpenVSwitch.class), any(Map.class))).thenReturn(managerEntries);
 
@@ -125,7 +125,7 @@ public class OvsdbManagersUpdateCommandTest {
     @Test
     public void testUpdateManagers1() throws Exception {
         ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
-        Map<Uri, Manager> updatedManagerRows = new HashMap<Uri, Manager>();
+        Map<Uri, Manager> updatedManagerRows = new HashMap<>();
         OvsdbConnectionInstance ovsdbConnectionInstance = mock(OvsdbConnectionInstance.class);
         when(ovsdbManagersUpdateCommand.getOvsdbConnectionInstance()).thenReturn(ovsdbConnectionInstance);
         InstanceIdentifier<Node> connectionIId = mock(InstanceIdentifier.class);
index 5fac43c07410742918e23778e27b4165dcbcc845..fd6c8df318e789020eaaf270a42e9f5bc33d9694 100644 (file)
@@ -86,7 +86,7 @@ public class OvsdbNodeRemoveCommandTest {
 
         PowerMockito.doReturn(true).when(ovsdbNodeRemoveCommand, "checkIfOnlyConnectedManager", any(OvsdbNodeAugmentation.class));
 
-        List<ManagedNodeEntry> listManagedNodeEntry = new ArrayList<ManagedNodeEntry>();
+        List<ManagedNodeEntry> listManagedNodeEntry = new ArrayList<>();
         ManagedNodeEntry managedNode = mock(ManagedNodeEntry.class);
         listManagedNodeEntry.add(managedNode);
         when(ovsdbNodeAugmentation.getManagedNodeEntry()).thenReturn(listManagedNodeEntry);
@@ -106,7 +106,7 @@ public class OvsdbNodeRemoveCommandTest {
         OvsdbNodeAugmentation ovsdbNodeAugmentation = mock(OvsdbNodeAugmentation.class);
         ManagerEntry onlyConnectedManager= mock(ManagerEntry.class);
         ManagerEntry manager = mock(ManagerEntry.class);
-        List<ManagerEntry> listManagerEntry = new ArrayList<ManagerEntry>();
+        List<ManagerEntry> listManagerEntry = new ArrayList<>();
         listManagerEntry.add(manager);
 
         //case 1: connectedManager > ONE_CONNECTED_MANAGER
index 3853af077184c527f214144c0cf4d68c1050f373..e2955720a0d2ad5e07ee5e831ec56396b2fd242b 100644 (file)
@@ -32,7 +32,7 @@ import org.powermock.reflect.Whitebox;
 @RunWith(PowerMockRunner.class)
 public class OvsdbOperationalCommandAggregatorTest {
     private static final int NUMBER_OF_COMMANDS = 9;
-    private List<TransactionCommand> commands = new ArrayList<TransactionCommand>();
+    private List<TransactionCommand> commands = new ArrayList<>();
     private OvsdbOperationalCommandAggregator ovsdbOperationalCommandAggregator;
 
     @Before
index ac7658c57cef59b45633f7389c2e447e1a91620c..840a49cde3263ca5ec38779efa92312b432a2c4d 100644 (file)
@@ -290,7 +290,7 @@ import com.google.common.util.concurrent.CheckedFuture;
     @Test
     public void testGetTerminationPointBridge() throws Exception {
         UUID portUUID = mock(UUID.class);
-        bridgeUpdatedRows = new HashMap<UUID, Bridge>();
+        bridgeUpdatedRows = new HashMap<>();
         UUID bridgeUUID = mock(UUID.class);
         Bridge bridge = mock(Bridge.class);
         bridgeUpdatedRows.put(bridgeUUID, bridge);
index 5adf90027deec150d9e01548e0d79360d1b105ab..1308612fc7d86ef5192293eb7d8bba699115f33f 100644 (file)
@@ -49,16 +49,16 @@ public class TransactionInvokerImplTest {
     private static final int QUEUE_SIZE = 10000;
     @Mock private BindingTransactionChain chain;
     @Mock private DataBroker db;
-    private BlockingQueue<TransactionCommand> inputQueue = new LinkedBlockingQueue<TransactionCommand>(QUEUE_SIZE);
+    private BlockingQueue<TransactionCommand> inputQueue = new LinkedBlockingQueue<>(QUEUE_SIZE);
     private BlockingQueue<ReadWriteTransaction> successfulTransactionQueue
-        = new LinkedBlockingQueue<ReadWriteTransaction>(QUEUE_SIZE);
+        = new LinkedBlockingQueue<>(QUEUE_SIZE);
     private BlockingQueue<AsyncTransaction<?, ?>> failedTransactionQueue
-        = new LinkedBlockingQueue<AsyncTransaction<?, ?>>(QUEUE_SIZE);
+        = new LinkedBlockingQueue<>(QUEUE_SIZE);
     @Mock private ExecutorService executor;
     @Mock private AtomicBoolean runTask;
     private Map<ReadWriteTransaction,TransactionCommand> transactionToCommand
-        = new HashMap<ReadWriteTransaction,TransactionCommand>();
-    private List<ReadWriteTransaction> pendingTransactions = new ArrayList<ReadWriteTransaction>();
+        = new HashMap<>();
+    private List<ReadWriteTransaction> pendingTransactions = new ArrayList<>();
     private TransactionInvokerImpl transactionInvokerImpl;
 
     @Before
@@ -111,7 +111,7 @@ public class TransactionInvokerImplTest {
         pendingTransactions.add((ReadWriteTransaction) tx2);
         MemberModifier.field(TransactionInvokerImpl.class, "pendingTransactions").set(transactionInvokerImpl, pendingTransactions);
 
-        List<ReadWriteTransaction> transactions= new ArrayList<ReadWriteTransaction>();
+        List<ReadWriteTransaction> transactions= new ArrayList<>();
         transactions.add((ReadWriteTransaction) tx1);
 
         TransactionCommand txCommand = mock(TransactionCommand.class);
@@ -121,7 +121,7 @@ public class TransactionInvokerImplTest {
         MemberModifier.field(TransactionInvokerImpl.class, "transactionToCommand").set(transactionInvokerImpl, transactionToCommand);
         PowerMockito.suppress(MemberModifier.method(TransactionInvokerImpl.class, "resetTransactionQueue"));
 
-        List<TransactionCommand> testCommands = new ArrayList<TransactionCommand>();
+        List<TransactionCommand> testCommands = new ArrayList<>();
         testCommands.add(txCommand);
 
         assertEquals(testCommands, Whitebox.invokeMethod(transactionInvokerImpl, "extractResubmitCommands"));
@@ -180,7 +180,7 @@ public class TransactionInvokerImplTest {
         TransactionCommand command = mock(TransactionCommand.class);
         inputQueue.add(command);
         MemberModifier.field(TransactionInvokerImpl.class, "inputQueue").set(transactionInvokerImpl, inputQueue);
-        List<TransactionCommand> testResult = new ArrayList<TransactionCommand>();
+        List<TransactionCommand> testResult = new ArrayList<>();
         testResult.add(command);
         assertEquals(testResult, Whitebox.invokeMethod(transactionInvokerImpl, "extractCommandsFromQueue"));
     }