Bug 8055: use Java collection constructors 82/53482/4
authorStephen Kitt <skitt@redhat.com>
Fri, 10 Mar 2017 16:37:29 +0000 (17:37 +0100)
committerStephen Kitt <skitt@redhat.com>
Thu, 23 Mar 2017 15:23:37 +0000 (16:23 +0100)
... instead of Guava's, where appropriate.

Change-Id: I4f20e86bd65d5b7a530fa631721d1ed7a4345c19
Signed-off-by: Stephen Kitt <skitt@redhat.com>
53 files changed:
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionInstance.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/reconciliation/configuration/GlobalConfigOperationalChangeGetter.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/reconciliation/configuration/SwitchConfigOperationalChangeGetter.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/AbstractTransactCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/HwvtepOperationalState.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsLocalRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsRemoteUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalPortRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalPortUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalSwitchRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalSwitchUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/UcastMacsLocalRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/UcastMacsRemoteUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TestBuilders.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/impl/OvsdbClientImpl.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/impl/OvsdbConnectionService.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonRpc10Request.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonRpc10Response.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonRpcEndpoint.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/message/TableUpdate.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/message/TableUpdates.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/message/TransactBuilder.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/OvsdbMap.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/OvsdbSet.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/Row.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/operations/Delete.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/operations/Insert.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/operations/Mutate.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/operations/Select.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/operations/TransactionBuilder.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/operations/Update.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/schema/BaseType.java
library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/OvsdbClientTestIT.java
library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/ovsdbclient/OvsdbClientTestTypedIT.java
library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/schema/HardwareVTEPIT.java
library/it/src/test/java/org/opendaylight/ovsdb/integrationtest/schema/OpenVSwitchIT.java
library/it/src/test/java/org/opendaylight/ovsdb/lib/it/LibraryIT.java
library/it/src/test/java/org/opendaylight/ovsdb/lib/it/LibraryIntegrationTestBase.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstance.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachRemovedCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeRemovedCommand.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/ControllerRemovedCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ControllerUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/OpenVSwitchBridgeAddCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ProtocolRemovedCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ProtocolUpdateCommand.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/TerminationPointDeleteCommand.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/TransactUtils.java
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java

index c8c859a80d4f226e95eb509fe07e92c1f3570ce5..c8eab8b1e24d4a88245e2a1517468b6ed7f07aa1 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.ovsdb.hwvtepsouthbound;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -51,7 +52,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.ListenableFuture;
 
 public class HwvtepConnectionInstance {
@@ -126,7 +126,7 @@ public class HwvtepConnectionInstance {
     private void monitorAllTables(String database, DatabaseSchema dbSchema) {
         Set<String> tables = dbSchema.getTables();
         if (tables != null) {
-            List<MonitorRequest> monitorRequests = Lists.newArrayList();
+            List<MonitorRequest> monitorRequests = new ArrayList<>();
             for (String tableName : tables) {
                 if (!HwvtepSouthboundConstants.SKIP_HWVTEP_TABLE.containsKey(tableName)) {
                     LOG.info("HwvtepSouthbound monitoring Hwvtep schema table {}", tableName);
index 6dbc483f97388caa74b2840bd292de4634b220b7..5f0118d94cb89c7e1fc0335a3cf854a3cad86762 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.ovsdb.hwvtepsouthbound.reconciliation.configuration;
 
-import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import java.util.stream.Collectors;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
@@ -91,8 +90,8 @@ public class GlobalConfigOperationalChangeGetter {
     static  Set<String> getLogicalSwitchesToBeRemoved(Node configNode, Node opNode) {
         Set<String> opSwitchNames = new HashSet<>();
         Set<String> cfgSwitchNames = new HashSet<>();
-        List<LogicalSwitches> cfgLogicalSwitches = Lists.newArrayList();
-        List<LogicalSwitches> opLogicalSwitches = Lists.newArrayList();
+        List<LogicalSwitches> cfgLogicalSwitches = new ArrayList<>();
+        List<LogicalSwitches> opLogicalSwitches = new ArrayList<>();
 
         if (opNode != null && opNode.getAugmentation(HwvtepGlobalAugmentation.class) != null) {
             opLogicalSwitches = opNode.getAugmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches();
index ab090637868e123f2881d419a024549006fddbb6..f87fcdeb0ca57cbf04de48b614ee197e7fb1fbb3 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.ovsdb.hwvtepsouthbound.reconciliation.configuration;
 
-import com.google.common.collect.Lists;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalPortAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalPortAugmentationBuilder;
@@ -56,7 +55,7 @@ public class SwitchConfigOperationalChangeGetter {
         } else {
             newNodeBuilder = new NodeBuilder();
         }
-        List<TerminationPoint> emptyList = Lists.newArrayList();
+        List<TerminationPoint> emptyList = new ArrayList<>();
         newNodeBuilder.setTerminationPoint(emptyList);
 
         return newNodeBuilder;
@@ -64,7 +63,7 @@ public class SwitchConfigOperationalChangeGetter {
 
 
     static List<TerminationPoint> getPorts(Node node) {
-        ArrayList<TerminationPoint> tpList = Lists.newArrayList();
+        ArrayList<TerminationPoint> tpList = new ArrayList<>();
         if (node == null || node.getTerminationPoint() == null) {
             return tpList;
         }
index c90f6ffebec34d9741649884de111c51ba376a8a..2688a20003946007766fa51ac13d13cf7684318d 100644 (file)
@@ -20,7 +20,6 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 
-import com.google.common.collect.Lists;
 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepDeviceInfo;
@@ -84,7 +83,7 @@ public abstract class AbstractTransactCommand<T extends Identifiable, Aug extend
 
         //If this key itself is in transit wait for the response of this key itself
         if (deviceInfo.isKeyInTransit((Class<? extends Identifiable>) classType, key)) {
-            inTransitDependencies.put(classType, Lists.newArrayList(key));
+            inTransitDependencies.put(classType, Collections.singletonList(key));
         }
 
         if (HwvtepSouthboundUtil.isEmptyMap(confingDependencies) && HwvtepSouthboundUtil.isEmptyMap(inTransitDependencies)) {
@@ -150,20 +149,20 @@ public abstract class AbstractTransactCommand<T extends Identifiable, Aug extend
         if (augmentation != null) {
             List<T> data = getData(augmentation);
             if (data != null) {
-                return Lists.newArrayList(data);
+                return new ArrayList<>(data);
             }
         }
-        return Collections.EMPTY_LIST;
+        return Collections.emptyList();
     }
 
     protected Map<InstanceIdentifier<Node>, List<T>> extractRemoved(
             Collection<DataTreeModification<Node>> changes, Class<T> class1) {
         Map<InstanceIdentifier<Node>, List<T>> result = new HashMap<>();
-        List<T> removed = Collections.EMPTY_LIST;
         if (changes != null && !changes.isEmpty()) {
             for (DataTreeModification<Node> change : changes) {
                 final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
                 Class<? extends Identifiable> classType = (Class<? extends Identifiable>) getClassType();
+                List<T> removed;
                 if (operationalState.isInReconciliation()) {
                     removed = getRemoved(change);
                 } else {
@@ -236,9 +235,9 @@ public abstract class AbstractTransactCommand<T extends Identifiable, Aug extend
         List<T> data1 = getData(include);
         List<T> data2 = diffOf(a, b, compareKeyOnly);
         if (HwvtepSouthboundUtil.isEmpty(data1) && HwvtepSouthboundUtil.isEmpty(data2)) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
-        List<T> result = Lists.newArrayList(data1);
+        List<T> result = new ArrayList<>(data1);
         result.addAll(data2);
         return result;
     }
@@ -250,10 +249,10 @@ public abstract class AbstractTransactCommand<T extends Identifiable, Aug extend
         List<T> list2 = getData(b);
 
         if (HwvtepSouthboundUtil.isEmpty(list1)) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
         if (HwvtepSouthboundUtil.isEmpty(list2)) {
-            return HwvtepSouthboundUtil.isEmpty(list1) ? Collections.EMPTY_LIST : list1;
+            return HwvtepSouthboundUtil.isEmpty(list1) ? Collections.emptyList() : list1;
         }
 
         Iterator<T> it1 = list1.iterator();
index a74fdd52274f4bd34d60bdc18242d65b945661a5..d7c2262797476655b9cc06d9782938a55b765f6a 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.ovsdb.hwvtepsouthbound.transact;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.Maps;
 import org.apache.commons.lang3.tuple.Pair;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
@@ -62,7 +61,7 @@ public class HwvtepOperationalState {
 
     private Map<InstanceIdentifier<Node>, Node> operationalNodes = new HashMap<>();
     private ReadWriteTransaction transaction;
-    HashMap<InstanceIdentifier<TerminationPoint>, UUID> inflightLocators = Maps.newHashMap();
+    HashMap<InstanceIdentifier<TerminationPoint>, UUID> inflightLocators = new HashMap<>();
     private HwvtepDeviceInfo deviceInfo;
     private HwvtepConnectionInstance connectionInstance;
     private Map<Class<? extends Identifiable>, Map<InstanceIdentifier, UUID>> currentTxUUIDs = new ConcurrentHashMap<>();
index 1d6783dc0f9a91dde3ccc9f5810d773a60f4c2f0..fc10a3b5644fb978419efe63b86022cc31b3a6d4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016 China Telecom Beijing Research Institute and others.  All rights reserved.
+ * Copyright © 2015, 2017 China Telecom Beijing Research Institute and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -16,7 +16,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import com.google.common.collect.Lists;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.ovsdb.lib.notation.UUID;
 import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
@@ -93,12 +92,12 @@ public class McastMacsLocalRemoveCommand extends AbstractTransactCommand<LocalMc
 
     public static class MacDependencyGetter extends UnMetDependencyGetter<LocalMcastMacs> {
         public List<InstanceIdentifier<?>> getLogicalSwitchDependencies(LocalMcastMacs data) {
-            return Lists.newArrayList(data.getLogicalSwitchRef().getValue());
+            return Collections.singletonList(data.getLogicalSwitchRef().getValue());
         }
 
         @Override
         public List<InstanceIdentifier<?>> getTerminationPointDependencies(LocalMcastMacs data) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
     }
 }
index 50b5b68523ad17847ac09db63ce25db76def0080..4f986e0cb1c58715c18f5958851fef2999ac0778 100644 (file)
@@ -18,7 +18,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Objects;
 
-import com.google.common.collect.Lists;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundConstants;
 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundUtil;
@@ -170,14 +169,14 @@ public class McastMacsRemoteUpdateCommand extends AbstractTransactCommand<Remote
 
         public List<InstanceIdentifier<?>> getLogicalSwitchDependencies(RemoteMcastMacs data) {
             if (data == null) {
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             }
-            return Lists.newArrayList(data.getLogicalSwitchRef().getValue());
+            return Collections.singletonList(data.getLogicalSwitchRef().getValue());
         }
 
         public List<InstanceIdentifier<?>> getTerminationPointDependencies(RemoteMcastMacs data) {
             if (data == null || HwvtepSouthboundUtil.isEmpty(data.getLocatorSet())) {
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             }
             List<InstanceIdentifier<?>> locators = new ArrayList<>();
             for (LocatorSet locator: data.getLocatorSet()) {
index b6e3709aa80c7290eb54deba54d577db5b6cdfe6..daa89081407d3a1fdeaf54d34f89323b9fa2cd63 100644 (file)
@@ -12,6 +12,7 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -33,7 +34,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 
 public class PhysicalPortRemoveCommand extends AbstractTransactCommand {
     private static final Logger LOG = LoggerFactory.getLogger(PhysicalPortRemoveCommand.class);
@@ -75,7 +75,7 @@ public class PhysicalPortRemoveCommand extends AbstractTransactCommand {
                 transaction.add(op.comment("Physical Port: Deleting " + port.getHwvtepNodeName().getValue()));
                 transaction.add(op.mutate(physicalSwitch.getSchema())
                         .addMutation(physicalSwitch.getPortsColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(physicalPortUuid)));
+                                Collections.singleton(physicalPortUuid)));
                 transaction.add(op.comment("Physical Switch: Mutating " + port.getHwvtepNodeName().getValue() + " " + physicalPortUuid));
             } else {
                 LOG.warn("Unable to delete logical switch {} because it was not found in the operational store, "
index 1e4637d697296f5efa94307b6819d77442ab91ee..f8b896e0a234960f5c58d6e6bd97adfed326de28 100644 (file)
@@ -12,6 +12,7 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -38,7 +39,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 
 public class PhysicalPortUpdateCommand extends AbstractTransactCommand {
     private static final Logger LOG = LoggerFactory.getLogger(PhysicalPortUpdateCommand.class);
@@ -95,7 +95,7 @@ public class PhysicalPortUpdateCommand extends AbstractTransactCommand {
                 //update physical switch table
                 PhysicalSwitch physicalSwitch = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), PhysicalSwitch.class);
                 physicalSwitch.setName(physicalSwitchBelong.getHwvtepNodeName().getValue());
-                physicalSwitch.setPorts(Sets.newHashSet(new UUID(portUuid)));
+                physicalSwitch.setPorts(Collections.singleton(new UUID(portUuid)));
                 LOG.trace("execute: mutating physical switch: {}", physicalSwitch);
                 transaction.add(op.mutate(physicalSwitch)
                         .addMutation(physicalSwitch.getPortsColumn().getSchema(), Mutator.INSERT,
index f8cedec9faa8ee95e225d573c58e48926419a585..a2a0e3a54532cc4182b51894d1b559d322ddd1a0 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.ovsdb.hwvtepsouthbound.transact;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -30,7 +31,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 
 public class PhysicalSwitchRemoveCommand extends AbstractTransactCommand {
     private static final Logger LOG = LoggerFactory.getLogger(PhysicalSwitchRemoveCommand.class);
@@ -68,7 +68,7 @@ public class PhysicalSwitchRemoveCommand extends AbstractTransactCommand {
             transaction.add(op.comment("Physical Switch: Deleting " + physicalSwitchAugmentation.getHwvtepNodeName().getValue()));
             transaction.add(op.mutate(global.getSchema())
                     .addMutation(global.getSwitchesColumn().getSchema(), Mutator.DELETE,
-                            Sets.newHashSet(physicalSwitchUuid)));
+                            Collections.singleton(physicalSwitchUuid)));
             transaction.add(op.comment("Global: Mutating " + physicalSwitchAugmentation.getHwvtepNodeName().getValue() + " " + physicalSwitchUuid));
         } else {
             LOG.warn("Unable to delete physical switch {} because it was not found in the operational store",
index f1f3c7ba291cb341045d3faac9dd556ac2dfc0ee..5295914c6907d8c1783ef07e289fcbd543e9eaa9 100644 (file)
@@ -12,6 +12,7 @@ import static org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundUtil.schem
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -101,7 +102,7 @@ public class PhysicalSwitchUpdateCommand extends AbstractTransactCommand {
                             physicalSwitchAugmentation.getHwvtepNodeName().getValue()));
             //update global table
             Global global = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Global.class);
-            global.setSwitches(Sets.newHashSet(new UUID(pswitchUuid)));
+            global.setSwitches(Collections.singleton(new UUID(pswitchUuid)));
 
             LOG.trace("execute: create physical switch: {}", physicalSwitch);
             transaction.add(op.mutate(global)
@@ -201,7 +202,7 @@ public class PhysicalSwitchUpdateCommand extends AbstractTransactCommand {
                             PhysicalSwitch pSwitch =
                                             TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(),
                                                             PhysicalSwitch.class);
-                            pSwitch.setTunnels(Sets.newHashSet(new UUID(tunnelUuid)));
+                            pSwitch.setTunnels(Collections.singleton(new UUID(tunnelUuid)));
                             pSwitch.setName(physicalSwitchAugmentation.getHwvtepNodeName().getValue());
                             transaction.add(op.mutate(pSwitch)
                                             .addMutation(pSwitch.getTunnels().getSchema(), Mutator.INSERT,
index 1cec98b0cd0ccdb1875d65bbd9ac1b80cf62848a..557040049bffbcdcd605c0caceae7a0ae763128d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016 China Telecom Beijing Research Institute and others.  All rights reserved.
+ * Copyright © 2015, 2017 China Telecom Beijing Research Institute and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -16,7 +16,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import com.google.common.collect.Lists;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.ovsdb.lib.notation.UUID;
 import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
@@ -94,12 +93,12 @@ public class UcastMacsLocalRemoveCommand extends AbstractTransactCommand<LocalUc
     public static class MacDependencyGetter extends UnMetDependencyGetter<LocalUcastMacs> {
         @Override
         public List<InstanceIdentifier<?>> getLogicalSwitchDependencies(LocalUcastMacs data) {
-            return Lists.newArrayList(data.getLogicalSwitchRef().getValue());
+            return Collections.singletonList(data.getLogicalSwitchRef().getValue());
         }
 
         @Override
         public List<InstanceIdentifier<?>> getTerminationPointDependencies(LocalUcastMacs data) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
     }
 }
\ No newline at end of file
index 03be8d95fda6e86a9ffb127575d9b3bf9da640d7..28c1a936c3443419f84ed8950bfa7245efa5a1b5 100644 (file)
@@ -10,8 +10,6 @@ package org.opendaylight.ovsdb.hwvtepsouthbound.transact;
 
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
-import com.google.common.collect.Lists;
-
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepDeviceInfo;
 import org.opendaylight.ovsdb.lib.notation.UUID;
@@ -171,16 +169,16 @@ public class UcastMacsRemoteUpdateCommand extends AbstractTransactCommand<Remote
 
         public List<InstanceIdentifier<?>> getLogicalSwitchDependencies(RemoteUcastMacs data) {
             if (data == null) {
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             }
-            return Lists.newArrayList(data.getLogicalSwitchRef().getValue());
+            return Collections.singletonList(data.getLogicalSwitchRef().getValue());
         }
 
         public List<InstanceIdentifier<?>> getTerminationPointDependencies(RemoteUcastMacs data) {
             if (data == null) {
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             }
-            return Lists.newArrayList(data.getLocatorRef().getValue());
+            return Collections.singletonList(data.getLocatorRef().getValue());
         }
     }
 }
\ No newline at end of file
index 2290920b1de60a0517c47978a41e523b4d665d51..9febd6252b70b97f84545a2b6f20f23600a23f32 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright © 2016, 2017 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -9,6 +9,7 @@
 package org.opendaylight.ovsdb.hwvtepsouthbound;
 
 import com.google.common.collect.Lists;
+import java.util.ArrayList;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
@@ -45,7 +46,7 @@ public class TestBuilders {
     public static final String VXLAN_OVER_IPV4 = "vxlan_over_ipv4";
 
     public static List<LogicalSwitches> addLogicalSwitches(HwvtepGlobalAugmentationBuilder augmentationBuilder, String[]... data) {
-        List<LogicalSwitches> logicalSwitcheses = Lists.newArrayList();
+        List<LogicalSwitches> logicalSwitcheses = new ArrayList<>();
         for (String row[] : data) {
             logicalSwitcheses.add(TestBuilders.buildLogicalSwitch(row));
         }
@@ -55,7 +56,7 @@ public class TestBuilders {
 
     public static List<RemoteMcastMacs> addRemoteMcastMacs(InstanceIdentifier<Node> iid,
                                           HwvtepGlobalAugmentationBuilder augmentationBuilder, String[]... data) {
-        List<RemoteMcastMacs> remoteMcastMacses = Lists.newArrayList();
+        List<RemoteMcastMacs> remoteMcastMacses = new ArrayList<>();
         for (String row[] : data) {
             String teps[] = Arrays.copyOfRange(row, 2, row.length);
             remoteMcastMacses.add(TestBuilders.buildRemoteMcastMacs(iid, row[0], row[1], teps));
@@ -67,7 +68,7 @@ public class TestBuilders {
     public static List<RemoteUcastMacs> addRemoteUcastMacs(InstanceIdentifier<Node> iid,
                                                            HwvtepGlobalAugmentationBuilder augmentationBuilder,
                                                            String[]... data) {
-        List<RemoteUcastMacs> remoteUcastMacses = Lists.newArrayList();
+        List<RemoteUcastMacs> remoteUcastMacses = new ArrayList<>();
         for (String row[] : data) {
             remoteUcastMacses.add(TestBuilders.buildRemoteUcastMacs(iid, row[0], row[1], row[2], row[3]));
         }
@@ -77,7 +78,7 @@ public class TestBuilders {
 
     public static void addGlobalTerminationPoints(NodeBuilder nodeBuilder, InstanceIdentifier<Node> nodeIid,
                                                   String[]... data) {
-        List<TerminationPoint> terminationPoints = Lists.newArrayList();
+        List<TerminationPoint> terminationPoints = new ArrayList<>();
         for (String row[] : data) {
             terminationPoints.add(TestBuilders.buildTerminationPoint(nodeIid, row[0]));
         }
@@ -141,7 +142,7 @@ public class TestBuilders {
         }
         mMacLocalBuilder.setMacEntryUuid(getUUid(mac));
         mMacLocalBuilder.setLogicalSwitchRef(buildLogicalSwitchesRef(iid, logicalSwitchName));
-        List<LocatorSet> locatorSets = Lists.newArrayList();
+        List<LocatorSet> locatorSets = new ArrayList<>();
         for (String tepIp : tepIps) {
             locatorSets.add(new LocatorSetBuilder().setLocatorRef(
                     buildLocatorRef(iid, tepIp)).build());
index 0864d519c61e12bd766a428ddb550a1375ca4409..290b0fe70d3d3c9a5d6f8a0a5e5d3bcc1db129c5 100644 (file)
@@ -12,13 +12,15 @@ import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.google.common.base.Function;
 import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import io.netty.channel.Channel;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -62,8 +64,8 @@ public class OvsdbClientImpl implements OvsdbClient {
     private static final Logger LOG = LoggerFactory.getLogger(OvsdbClientImpl.class);
     private ExecutorService executorService;
     private OvsdbRPC rpc;
-    private Map<String, DatabaseSchema> schemas = Maps.newHashMap();
-    private Map<String, CallbackContext> monitorCallbacks = Maps.newHashMap();
+    private Map<String, DatabaseSchema> schemas = new HashMap<>();
+    private Map<String, CallbackContext> monitorCallbacks = new HashMap<>();
     private OvsdbRPC.Callback rpcCallback;
     private OvsdbConnectionInfo connectionInfo;
     private Channel channel;
@@ -152,7 +154,7 @@ public class OvsdbClientImpl implements OvsdbClient {
     protected TableUpdates transformingCallback(JsonNode tableUpdatesJson, DatabaseSchema dbSchema) {
         //todo(ashwin): we should move all the JSON parsing logic to a utility class
         if (tableUpdatesJson instanceof ObjectNode) {
-            Map<String, TableUpdate> tableUpdateMap = Maps.newHashMap();
+            Map<String, TableUpdate> tableUpdateMap = new HashMap<>();
             ObjectNode updatesJson = (ObjectNode) tableUpdatesJson;
             for (Iterator<Map.Entry<String,JsonNode>> itr = updatesJson.fields(); itr.hasNext();) {
                 Map.Entry<String, JsonNode> entry = itr.next();
@@ -191,7 +193,7 @@ public class OvsdbClientImpl implements OvsdbClient {
         registerCallback(monitorHandle, callback, dbSchema);
 
         ListenableFuture<JsonNode> monitor = rpc.monitor(
-            () -> Lists.newArrayList(dbSchema.getName(), monitorHandle.getId(), reqMap));
+            () -> Arrays.asList(dbSchema.getName(), monitorHandle.getId(), reqMap));
         JsonNode result;
         try {
             result = monitor.get();
@@ -214,7 +216,7 @@ public class OvsdbClientImpl implements OvsdbClient {
         registerCallback(monitorHandle, callback, dbSchema);
 
         ListenableFuture<JsonNode> monitor = rpc.monitor(
-            () -> Lists.newArrayList(dbSchema.getName(), monitorHandle.getId(), reqMap));
+            () -> Arrays.asList(dbSchema.getName(), monitorHandle.getId(), reqMap));
         JsonNode result;
         try {
             result = monitor.get();
@@ -232,7 +234,7 @@ public class OvsdbClientImpl implements OvsdbClient {
 
     @Override
     public void cancelMonitor(final MonitorHandle handler) {
-        ListenableFuture<JsonNode> cancelMonitor = rpc.monitor_cancel(() -> Lists.newArrayList(handler.getId()));
+        ListenableFuture<JsonNode> cancelMonitor = rpc.monitor_cancel(() -> Collections.singletonList(handler.getId()));
 
         JsonNode result = null;
         try {
@@ -307,7 +309,7 @@ public class OvsdbClientImpl implements OvsdbClient {
 
         if (databaseSchema == null) {
             return Futures.transform(
-                getSchemaFromDevice(Lists.newArrayList(database)),
+                getSchemaFromDevice(Collections.singletonList(database)),
                 (Function<Map<String, DatabaseSchema>, DatabaseSchema>) result -> {
                     if (result.containsKey(database)) {
                         DatabaseSchema dbSchema = result.get(database);
@@ -324,7 +326,7 @@ public class OvsdbClientImpl implements OvsdbClient {
     }
 
     private ListenableFuture<Map<String, DatabaseSchema>> getSchemaFromDevice(final List<String> dbNames) {
-        Map<String, DatabaseSchema> schema = Maps.newHashMap();
+        Map<String, DatabaseSchema> schema = new HashMap<>();
         SettableFuture<Map<String, DatabaseSchema>> future = SettableFuture.create();
         populateSchema(dbNames, schema, future);
         return future;
@@ -338,7 +340,7 @@ public class OvsdbClientImpl implements OvsdbClient {
             return;
         }
 
-        Futures.transform(rpc.get_schema(Lists.newArrayList(dbNames.get(0))),
+        Futures.transform(rpc.get_schema(Collections.singletonList(dbNames.get(0))),
             (Function<JsonNode, Void>) jsonNode -> {
                 try {
                     schema.put(dbNames.get(0), DatabaseSchema.fromJson(dbNames.get(0), jsonNode));
index 75c7701589d2e7f5b021c6b6f6b0fffb5246d4e3..79152a716c1981b7c26580db32b14544c856e3fa 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.ovsdb.lib.impl;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -39,6 +38,7 @@ import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -97,7 +97,7 @@ public class OvsdbConnectionService implements AutoCloseable, OvsdbConnection {
     private static ExecutorService connectionNotifierService
             = Executors.newCachedThreadPool(connectionNotifierThreadFactory);
 
-    private static Set<OvsdbConnectionListener> connectionListeners = Sets.newHashSet();
+    private static Set<OvsdbConnectionListener> connectionListeners = new HashSet<>();
     private static Map<OvsdbClient, Channel> connections = new ConcurrentHashMap<>();
     private static OvsdbConnection connectionService;
     private static AtomicBoolean singletonCreated = new AtomicBoolean(false);
index 3c86ffd1a7211d9d3595eb663a1bd7d02d9a9de3..7ebc31bd0c9ad1b2abfa5f5d7a61bb967405aad4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015 EBay Software Foundation and others. All rights reserved.
+ * Copyright © 2013, 2017 EBay Software Foundation and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -9,13 +9,14 @@
 package org.opendaylight.ovsdb.lib.jsonrpc;
 
 import com.google.common.collect.Lists;
+import java.util.ArrayList;
 import java.util.List;
 
 public class JsonRpc10Request {
 
     String id;
     String method;
-    List<Object> params = Lists.newArrayList();
+    List<Object> params = new ArrayList<>();
 
     public JsonRpc10Request(String id) {
         setId(id);
index 6e73b8d99453e4b340a73e90ef2abf534a9d8de4..188752885f7d9c8c59be7c0287dddffa18f0dddd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015 EBay Software Foundation and others. All rights reserved.
+ * Copyright © 2013, 2017 EBay Software Foundation and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,14 +8,14 @@
 
 package org.opendaylight.ovsdb.lib.jsonrpc;
 
-import com.google.common.collect.Lists;
+import java.util.ArrayList;
 import java.util.List;
 
 public class JsonRpc10Response {
 
     String id;
     String error;
-    List<Object> result = Lists.newArrayList();
+    List<Object> result = new ArrayList<>();
 
     public JsonRpc10Response(String id) {
         setId(id);
index d64948d9135eb0f667985777e154df0f3505a55b..4a71897d62444699da23a7d6ead4d39dd4a1b3de 100644 (file)
@@ -13,7 +13,6 @@ import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.type.TypeFactory;
-import com.google.common.collect.Maps;
 import com.google.common.reflect.Invokable;
 import com.google.common.reflect.Reflection;
 import com.google.common.reflect.TypeToken;
@@ -24,6 +23,7 @@ import io.netty.channel.Channel;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
@@ -76,8 +76,8 @@ public class JsonRpcEndpoint {
 
     ObjectMapper objectMapper;
     Channel nettyChannel;
-    Map<String, CallContext> methodContext = Maps.newHashMap();
-    Map<Object, OvsdbRPC.Callback> requestCallbacks = Maps.newHashMap();
+    Map<String, CallContext> methodContext = new HashMap<>();
+    Map<Object, OvsdbRPC.Callback> requestCallbacks = new HashMap<>();
 
     public JsonRpcEndpoint(ObjectMapper objectMapper, Channel channel) {
         this.objectMapper = objectMapper;
index 180192f89b76664c0a9c7d123e4b7f01b5ccc07e..b10f7b5335b8da4376799bac526958445573a02d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015 EBay Software Foundation and others. All rights reserved.
+ * Copyright © 2014, 2017 EBay Software Foundation and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,7 +8,7 @@
 
 package org.opendaylight.ovsdb.lib.message;
 
-import com.google.common.collect.Maps;
+import java.util.HashMap;
 import java.util.Map;
 import org.opendaylight.ovsdb.lib.notation.Row;
 import org.opendaylight.ovsdb.lib.notation.UUID;
@@ -62,7 +62,7 @@ public class TableUpdate<E extends TableSchema<E>> {
 
     public TableUpdate() {
         super();
-        rows = Maps.newHashMap();
+        rows = new HashMap<>();
     }
 
     public void addRow(UUID uuid, Row<E> oldRow, Row<E> newRow) {
index 11c0e297a9dcaab439fd02f08deebfdc4dc9ea05..281af9994bc5105912bac97c8000fa201b98f987 100644 (file)
@@ -8,21 +8,19 @@
 
 package org.opendaylight.ovsdb.lib.message;
 
-import com.google.common.collect.Maps;
+import java.util.HashMap;
 import java.util.Map;
 import org.opendaylight.ovsdb.lib.schema.TableSchema;
 
 
 public class TableUpdates extends Response {
 
-    Map<String, TableUpdate> map = Maps.newHashMap();
+    private final Map<String, TableUpdate> map = new HashMap<>();
 
-    public TableUpdates() {
-        this(Maps.newHashMap());
-    }
+    public TableUpdates() {}
 
     public TableUpdates(Map<String, TableUpdate> map) {
-        this.map = map;
+        this.map.putAll(map);
     }
 
     public <E extends TableSchema<E>> TableUpdate<E> getUpdate(TableSchema<E> table) {
index b45f85f69cec941f4da6ee7ee1ee56572f932fa4..62fa54af292851184cc4b41a3e62e9d1d6a69cb0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015 EBay Software Foundation and others. All rights reserved.
+ * Copyright © 2013, 2017 EBay Software Foundation and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,7 +8,7 @@
 
 package org.opendaylight.ovsdb.lib.message;
 
-import com.google.common.collect.Lists;
+import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.ovsdb.lib.jsonrpc.Params;
 import org.opendaylight.ovsdb.lib.operations.Operation;
@@ -16,8 +16,8 @@ import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
 
 public class TransactBuilder implements Params {
 
-    List<Operation> requests = Lists.newArrayList();
-    DatabaseSchema dbSchema;
+    private List<Operation> requests = new ArrayList<>();
+    private DatabaseSchema dbSchema;
 
     public TransactBuilder(DatabaseSchema dbSchema) {
         this.dbSchema = dbSchema;
@@ -29,9 +29,10 @@ public class TransactBuilder implements Params {
 
     @Override
     public List<Object> params() {
-        List<Object> lists = Lists.newArrayList((Object)dbSchema.getName());
-        lists.addAll(requests);
-        return lists;
+        List<Object> list = new ArrayList<>(requests.size() + 1);
+        list.add(dbSchema.getName());
+        list.addAll(requests);
+        return list;
     }
 
     public void addOperations(List<Operation> operation) {
index abaa288499081a76891fd2fdbf97236af7521e2f..7f7d17337a7c0632fdc6d706bd2b7cac12ed16ab 100644 (file)
@@ -11,7 +11,7 @@ package org.opendaylight.ovsdb.lib.notation;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.google.common.collect.ForwardingMap;
-import com.google.common.collect.Maps;
+import java.util.HashMap;
 import java.util.Map;
 import org.opendaylight.ovsdb.lib.notation.json.Converter;
 import org.opendaylight.ovsdb.lib.notation.json.OvsdbMapSerializer;
@@ -20,14 +20,12 @@ import org.opendaylight.ovsdb.lib.notation.json.OvsdbMapSerializer;
 @JsonSerialize(using = OvsdbMapSerializer.class)
 public class OvsdbMap<K, V> extends ForwardingMap<K, V> {
 
-    Map<K, V> target = Maps.newHashMap();
+    private final Map<K, V> target = new HashMap<>();
 
-    public OvsdbMap() {
-        this(Maps.newHashMap());
-    }
+    public OvsdbMap() {}
 
     public OvsdbMap(Map<K, V> value) {
-        this.target = value;
+        this.target.putAll(value);
     }
 
     @Override
index 7c29701a8027098b586f5f1552c43b2380294e13..797dc18243bb857a5abb7511e77e50588fec1aba 100644 (file)
@@ -11,7 +11,7 @@ package org.opendaylight.ovsdb.lib.notation;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.google.common.collect.ForwardingSet;
-import com.google.common.collect.Sets;
+import java.util.HashSet;
 import java.util.Set;
 import org.opendaylight.ovsdb.lib.notation.json.Converter;
 import org.opendaylight.ovsdb.lib.notation.json.OvsdbSetSerializer;
@@ -20,11 +20,9 @@ import org.opendaylight.ovsdb.lib.notation.json.OvsdbSetSerializer;
 @JsonSerialize(using = OvsdbSetSerializer.class)
 public class OvsdbSet<T> extends ForwardingSet<T> {
 
-    Set<T> target = null;
+    Set<T> target = new HashSet<>();
 
-    public OvsdbSet() {
-        this(Sets.newHashSet());
-    }
+    public OvsdbSet() {}
 
     public OvsdbSet(Set<T> backing) {
         this.target = backing;
index 9df2f14489c53a6255ce2df0c26ba7cb90464009..1e2eb46618b2e00779658e457c44569ad3d5773b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015 EBay Software Foundation and others. All rights reserved.
+ * Copyright © 2014, 2017 EBay Software Foundation and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,8 +10,8 @@ package org.opendaylight.ovsdb.lib.notation;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.google.common.collect.Maps;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.opendaylight.ovsdb.lib.notation.json.RowSerializer;
@@ -22,20 +22,16 @@ import org.opendaylight.ovsdb.lib.schema.TableSchema;
 public class Row<E extends TableSchema<E>> {
     @JsonIgnore
     private TableSchema<E> tableSchema;
-    protected Map<String, Column<E, ?>> columns;
+    protected Map<String, Column<E, ?>> columns = new HashMap<>();
 
-    public Row() {
-        this.columns = Maps.newHashMap();
-    }
+    public Row() {}
 
     public Row(TableSchema<E> tableSchema) {
         this.tableSchema = tableSchema;
-        this.columns = Maps.newHashMap();
     }
 
     public Row(TableSchema<E> tableSchema, List<Column<E, ?>> columns) {
         this.tableSchema = tableSchema;
-        this.columns = Maps.newHashMap();
         for (Column<E, ?> column : columns) {
             this.columns.put(column.getSchema().getName(), column);
         }
index 9b5f86112200c95381f7fb1cd85208d0c7da7715..aca5f155704efa6f5bffef80d476e46889277307 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright © 2014, 2017 Red Hat, Inc. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,7 +8,7 @@
 
 package org.opendaylight.ovsdb.lib.operations;
 
-import com.google.common.collect.Lists;
+import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.ovsdb.lib.notation.Condition;
 import org.opendaylight.ovsdb.lib.schema.TableSchema;
@@ -16,7 +16,7 @@ import org.opendaylight.ovsdb.lib.schema.TableSchema;
 public class Delete<E extends TableSchema<E>> extends Operation<E> implements ConditionalOperation {
 
     public static final String DELETE = "delete";
-    List<Condition> where = Lists.newArrayList();
+    List<Condition> where = new ArrayList<>();
     Integer count;
 
     public Delete(TableSchema<E> schema) {
index b421c18373c22a0334c7288e4fb370fe632ab318..18e788c88f74926ee741d7989514a55e0b4e15f7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 EBay Software Foundation and others. All rights reserved.
+ * Copyright © 2014, 2017 EBay Software Foundation and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -9,8 +9,8 @@
 package org.opendaylight.ovsdb.lib.operations;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.collect.Maps;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.Map;
 import org.opendaylight.ovsdb.lib.notation.Column;
 import org.opendaylight.ovsdb.lib.notation.Row;
@@ -28,7 +28,7 @@ public class Insert<E extends TableSchema<E>> extends Operation<E> {
     @JsonProperty("uuid-name")
     private String uuidName;
 
-    private Map<String, Object> row = Maps.newHashMap();
+    private Map<String, Object> row = new HashMap<>();
 
     public Insert<E> on(TableSchema<E> schema) {
         this.setTableSchema(schema);
index f09d20b80d170ea2e1bd2ed9d496dca8f617f4bd..3f4b8c07249479a35eb00971ef6e092ac647803e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015 Matt Oswalt and others. All rights reserved.
+ * Copyright © 2014, 2017 Matt Oswalt and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.ovsdb.lib.operations;
 
-import com.google.common.collect.Lists;
+import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.ovsdb.lib.notation.Condition;
 import org.opendaylight.ovsdb.lib.notation.Mutation;
@@ -18,8 +18,8 @@ import org.opendaylight.ovsdb.lib.schema.TableSchema;
 public class Mutate<E extends TableSchema<E>> extends Operation<E> implements ConditionalOperation {
 
     public static final String MUTATE = "mutate";
-    List<Condition> where = Lists.newArrayList();
-    private List<Mutation> mutations = Lists.newArrayList();
+    List<Condition> where = new ArrayList<>();
+    private List<Mutation> mutations = new ArrayList<>();
 
     public Mutate on(TableSchema schema) {
         this.setTableSchema(schema);
index 8628b3db4db6bbb7e216989e03edd0bbd30c8215..f3202766b08e0b0ac4e686032bdba5cf193439f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright © 2014, 2017 Red Hat, Inc. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,7 +8,7 @@
 
 package org.opendaylight.ovsdb.lib.operations;
 
-import com.google.common.collect.Lists;
+import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.ovsdb.lib.notation.Condition;
 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
@@ -17,8 +17,8 @@ import org.opendaylight.ovsdb.lib.schema.TableSchema;
 public class Select<E extends TableSchema<E>> extends Operation<E> implements ConditionalOperation {
 
     public static final String SELECT = "select";
-    List<Condition> where = Lists.newArrayList();
-    private List<String> columns = Lists.newArrayList();
+    private List<Condition> where = new ArrayList<>();
+    private List<String> columns = new ArrayList<>();
 
     public Select on(TableSchema schema) {
         this.setTableSchema(schema);
index 79dc014ca08083f6083b13d12261a216262b069a..0f17a1f226333b4e52095f16433bcc1f91fd540c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 EBay Software Foundation and others. All rights reserved.
+ * Copyright © 2014, 2017 EBay Software Foundation and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,8 +8,8 @@
 
 package org.opendaylight.ovsdb.lib.operations;
 
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.ListenableFuture;
+import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.ovsdb.lib.OvsdbClient;
 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
@@ -18,7 +18,7 @@ public class TransactionBuilder {
 
     private DatabaseSchema databaseSchema;
     OvsdbClient ovs;
-    List<Operation> operations = Lists.newArrayList();
+    List<Operation> operations = new ArrayList<>();
 
     public TransactionBuilder(OvsdbClient ovs, DatabaseSchema schema) {
         this.ovs = ovs;
index 6b9c11b1ed96e451ac4f7c2c533c274205568488..4fe2993a8ecad72efdf2a4a44e12b262e1df6894 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015 EBay Software Foundation and others. All rights reserved.
+ * Copyright © 2014, 2017 EBay Software Foundation and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,9 +8,9 @@
 
 package org.opendaylight.ovsdb.lib.operations;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.opendaylight.ovsdb.lib.notation.Column;
@@ -24,10 +24,10 @@ public class Update<E extends TableSchema<E>> extends Operation<E> implements Co
 
     public static final String UPDATE = "update";
 
-    Map<String, Object> row = Maps.newHashMap();
-    String uuid;
+    private final Map<String, Object> row = new HashMap<>();
+    private String uuid;
 
-    List<Condition> where = Lists.newArrayList();
+    private final List<Condition> where = new ArrayList<>();
 
     private String uuidName;
 
@@ -90,7 +90,8 @@ public class Update<E extends TableSchema<E>> extends Operation<E> implements Co
     }
 
     public void setRow(Map<String, Object> row) {
-        this.row = row;
+        this.row.clear();
+        this.row.putAll(row);
     }
 
     @Override
@@ -103,6 +104,7 @@ public class Update<E extends TableSchema<E>> extends Operation<E> implements Co
     }
 
     public void setWhere(List<Condition> where) {
-        this.where = where;
+        this.where.clear();
+        this.where.addAll(where);
     }
 }
index e40baa19e7b62229944017acbb583a8742de4e97..5f89931cbdf53e8bdef31a1f8e6f6771ee3e6b1e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015 EBay Software Foundation and others. All rights reserved.
+ * Copyright © 2014, 2017 EBay Software Foundation and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -9,7 +9,7 @@
 package org.opendaylight.ovsdb.lib.schema;
 
 import com.fasterxml.jackson.databind.JsonNode;
-import com.google.common.collect.Sets;
+import java.util.HashSet;
 import java.util.Optional;
 import java.util.Set;
 import org.opendaylight.ovsdb.lib.error.TyperException;
@@ -120,7 +120,7 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         private Optional<Set<Integer>> populateEnum(JsonNode node) {
             if (node.has("enum")) {
-                Set<Integer> nodesEnums = Sets.newHashSet();
+                Set<Integer> nodesEnums = new HashSet<>();
                 JsonNode anEnum = node.get("enum").get(1);
                 for (JsonNode enm : anEnum) {
                     nodesEnums.add(enm.asInt());
@@ -238,7 +238,7 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         private Optional<Set<Double>> populateEnum(JsonNode node) {
             if (node.has("enum")) {
-                Set<Double> nodesEnums = Sets.newHashSet();
+                Set<Double> nodesEnums = new HashSet<>();
                 JsonNode anEnum = node.get("enum").get(1);
                 for (JsonNode enm : anEnum) {
                     nodesEnums.add(enm.asDouble());
@@ -387,7 +387,7 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         private Optional<Set<String>> populateEnum(JsonNode node) {
             if (node.has("enum")) {
-                Set<String> nodesEnums = Sets.newHashSet();
+                Set<String> nodesEnums = new HashSet<>();
                 JsonNode enumVal = node.get("enum");
                 if (enumVal.isArray()) {
                     JsonNode anEnum = enumVal.get(1);
index 5f56fe20c554ec7cb8902efa964d4cc3778e4481..fd9661cdbfe04a03b1b005135a3867d52ae042a4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 EBay Software Foundation
+ * Copyright © 2014, 2017 EBay Software Foundation
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -20,6 +20,8 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -96,7 +98,7 @@ public class OvsdbClientTestIT extends LibraryIntegrationTestBase {
         assertNotNull(dbSchema);
         GenericTableSchema bridge = dbSchema.table("Bridge", GenericTableSchema.class);
 
-        List<MonitorRequest> monitorRequests = Lists.newArrayList();
+        List<MonitorRequest> monitorRequests = new ArrayList<>();
         ColumnSchema<GenericTableSchema, Set<Integer>> flood_vlans = bridge.multiValuedColumn("flood_vlans", Integer.class);
         ColumnSchema<GenericTableSchema, Map<String, String>> externalIds = bridge.multiValuedColumn("external_ids", String.class, String.class);
         ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
@@ -110,7 +112,7 @@ public class OvsdbClientTestIT extends LibraryIntegrationTestBase {
         monitorRequests.add(builder.with(new MonitorSelect(true, true, true, true))
                                    .build());
 
-        final List<Object> results = Lists.newArrayList();
+        final List<Object> results = new ArrayList<>();
 
         TableUpdates updates = ovs.monitor(dbSchema, monitorRequests, new MonitorCallBack() {
             @Override
@@ -243,7 +245,7 @@ public class OvsdbClientTestIT extends LibraryIntegrationTestBase {
                         .where(name.opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.mutate(ovsTable)
-                        .addMutation(bridges, Mutator.INSERT, Sets.newHashSet(new UUID(namedUuid)))
+                        .addMutation(bridges, Mutator.INSERT, Collections.singleton(new UUID(namedUuid)))
                         .where(_uuid.opEqual(parentTable))
                         .build())
                 .add(op.commit(true));
@@ -354,7 +356,7 @@ public class OvsdbClientTestIT extends LibraryIntegrationTestBase {
                         .where(name.opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.mutate(ovsTable)
-                        .addMutation(bridges, Mutator.DELETE, Sets.newHashSet(testBridgeUuid))
+                        .addMutation(bridges, Mutator.DELETE, Collections.singleton(testBridgeUuid))
                         .where(_uuid.opEqual(parentTable))
                         .build())
                 .add(op.commit(true))
index 7a0bf7d5b59d7684926088df6cc0d491f22c191e..4c7bafe0b7ac3546dd0eea46a674c74707bc1872 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 EBay Software Foundation
+ * Copyright © 2014, 2017 EBay Software Foundation
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -14,10 +14,10 @@ import static org.junit.Assert.assertTrue;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ExecutionException;
@@ -62,7 +62,7 @@ public class OvsdbClientTestTypedIT extends LibraryIntegrationTestBase {
         TestBridge rBridge = ovs.createTypedRowWrapper(TestBridge.class);
         rBridge.setName(TEST_BRIDGE_NAME);
         rBridge.setStatus(ImmutableMap.of("key","value"));
-        rBridge.setFloodVlans(Sets.newHashSet(34));
+        rBridge.setFloodVlans(Collections.singleton(34));
 
         GenericTableSchema ovsTable = dbSchema.table("Open_vSwitch", GenericTableSchema.class);
         ColumnSchema<GenericTableSchema, Set<UUID>> bridges = ovsTable.multiValuedColumn("bridges", UUID.class);
@@ -74,7 +74,7 @@ public class OvsdbClientTestTypedIT extends LibraryIntegrationTestBase {
                 .add(op.insert(rBridge)
                         .withId(namedUuid))
                 .add(op.mutate(ovsTable)
-                        .addMutation(bridges, Mutator.INSERT, Sets.newHashSet(new UUID(namedUuid))));
+                        .addMutation(bridges, Mutator.INSERT, Collections.singleton(new UUID(namedUuid))));
 
         ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
         List<OperationResult> operationResults = results.get();
@@ -127,7 +127,7 @@ public class OvsdbClientTestTypedIT extends LibraryIntegrationTestBase {
                         .where(name.opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.mutate(ovsTable)
-                        .addMutation(bridges, Mutator.DELETE, Sets.newHashSet(testBridgeUuid)))
+                        .addMutation(bridges, Mutator.DELETE, Collections.singleton(testBridgeUuid)))
                 .add(op.commit(true))
                 .execute();
 
index ae8ad4c6adf9a904e2a8862d32b190f676c837c4..99e271f97e942caa5f9af602a85d68d1c4e1a243 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Red Hat, Inc. and others.  All rights reserved.
+ * Copyright © 2014, 2017 Red Hat, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -12,7 +12,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assume.assumeTrue;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
-import com.google.common.collect.Sets;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
@@ -78,7 +78,7 @@ public class HardwareVTEPIT  extends LibraryIntegrationTestBase {
         String transactionUuidStr = "foobar";
 
         Global glbl = this.getClient().createTypedRowWrapper(Global.class);
-        glbl.setManagers(Sets.newHashSet(new UUID(transactionUuidStr)));
+        glbl.setManagers(Collections.singleton(new UUID(transactionUuidStr)));
 
         TransactionBuilder transactionBuilder = getClient().transactBuilder(getDbSchema())
                 .add(op.insert(manager.getSchema())
@@ -118,7 +118,7 @@ public class HardwareVTEPIT  extends LibraryIntegrationTestBase {
                 .add(op.comment("Manager: Deleting " + testManagerUuid))
                 .add(op.mutate(global.getSchema())
                         .addMutation(global.getManagersColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testManagerUuid)))
+                                Collections.singleton(testManagerUuid)))
                 .add(op.comment("Global: Mutating " + testManagerUuid))
                 .add(op.commit(true));
 
index df83cba30f7527a99421ab0265459dd8401cfd5e..45f32600cecf2c1ae416ba956c6c1c89200d8ec0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Red Hat, Inc. and others.  All rights reserved.
+ * Copyright © 2014, 2017 Red Hat, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -19,8 +19,7 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -112,10 +111,10 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
         Bridge bridge = getClient().createTypedRowWrapper(Bridge.class);
         bridge.setName(TEST_BRIDGE_NAME);
         bridge.setStatus(ImmutableMap.of("key", "value"));
-        bridge.setFloodVlans(Sets.newHashSet(34L));
+        bridge.setFloodVlans(Collections.singleton(34L));
 
         OpenVSwitch openVSwitch = getClient().createTypedRowWrapper(OpenVSwitch.class);
-        openVSwitch.setBridges(Sets.newHashSet(new UUID(TEST_BRIDGE_NAME)));
+        openVSwitch.setBridges(Collections.singleton(new UUID(TEST_BRIDGE_NAME)));
 
         TransactionBuilder transactionBuilder = getClient().transactBuilder(getDbSchema())
                 .add(op.insert(bridge.getSchema())
@@ -152,7 +151,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Bridge: Deleting " + TEST_BRIDGE_NAME))
                 .add(op.mutate(openVSwitch.getSchema())
                         .addMutation(openVSwitch.getBridgesColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(bridgeUuid)))
+                                Collections.singleton(bridgeUuid)))
                 .add(op.comment("Open_vSwitch: Mutating " + TEST_BRIDGE_NAME + " " + bridgeUuid))
                 .add(op.commit(true));
 
@@ -191,7 +190,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Controller: Inserting controller1 " + controller1.getTargetColumn().getData()))
                 .add(op.mutate(bridge.getSchema())
                         .addMutation(bridge.getControllerColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(controllerUuidStr)))
+                                Collections.singleton(new UUID(controllerUuidStr)))
                         .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.comment("Bridge: Mutating controller1 " + controller1.getTargetColumn().getData()));
@@ -217,7 +216,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Controller: Inserting controller2 " + controller2.getTargetColumn().getData()))
                 .add(op.mutate(bridge.getSchema())
                         .addMutation(bridge.getControllerColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(controllerUuidStr)))
+                                Collections.singleton(new UUID(controllerUuidStr)))
                         .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.comment("Bridge: Mutating controller2 " + controller2.getTargetColumn().getData()));
@@ -249,7 +248,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Controller: Deleting " + testController1Uuid))
                 .add(op.mutate(bridge.getSchema()) // Delete a controller column in the Bridge table
                         .addMutation(bridge.getControllerColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testController1Uuid)))
+                                Collections.singleton(testController1Uuid)))
                 .add(op.comment("Bridge: Mutating " + testController1Uuid))
                 .add(op.commit(true));
 
@@ -262,7 +261,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Controller: Deleting " + testController2Uuid))
                 .add(op.mutate(bridge.getSchema()) // Delete a controller column in the Bridge table
                         .addMutation(bridge.getControllerColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testController2Uuid)))
+                                Collections.singleton(testController2Uuid)))
                 .add(op.comment("Bridge: Mutating " + testController2Uuid))
                 .add(op.commit(true));
 
@@ -411,7 +410,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("FlowTable: Deleting " + testFlowTableUuid))
                 .add(op.mutate(bridge.getSchema())
                         .addMutation(bridge.getFlowTablesColumn().getSchema(), Mutator.DELETE,
-                                Maps.newHashMap(ImmutableMap.of(1L, testFlowTableUuid))))
+                                ImmutableMap.of(1L, testFlowTableUuid)))
                 .add(op.comment("Bridge: Mutating " + testFlowTableUuid))
                 .add(op.commit(true));
 
@@ -469,7 +468,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("IPFIX: Inserting " + ipfixUuidStr))
                 .add(op.mutate(bridge.getSchema())
                         .addMutation(bridge.getIpfixColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(ipfixUuidStr)))
+                                Collections.singleton(new UUID(ipfixUuidStr)))
                         .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.comment("Bridge: Mutating " + ipfixUuidStr));
@@ -499,7 +498,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("IPFIX: Deleting " + testIpfixUuid))
                 .add(op.mutate(bridge.getSchema()) // Delete a controller column in the Bridge table
                         .addMutation(bridge.getMirrorsColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testIpfixUuid)))
+                                Collections.singleton(testIpfixUuid)))
                 .add(op.comment("Bridge: Mutating " + testIpfixUuid))
                 .add(op.commit(true));
 
@@ -523,8 +522,8 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
         UUID openVSwitchRowUuid = getOpenVSwitchTableUuid(getClient(), getTableCache());
         OpenVSwitch openVSwitch = getClient().getTypedRowWrapper(OpenVSwitch.class, null);
         Manager manager = getClient().createTypedRowWrapper(Manager.class);
-        manager.setInactivityProbe(Sets.newHashSet(8192L));
-        manager.setMaxBackoff(Sets.newHashSet(4094L));
+        manager.setInactivityProbe(Collections.singleton(8192L));
+        manager.setMaxBackoff(Collections.singleton(4094L));
         manager.setTarget("tcp:172.16.50.50:6640");
         manager.setExternalIds(externalIds);
 
@@ -538,7 +537,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Manager: Inserting Slave Manager " + TEST_MANAGER_UUID_STR))
                 .add(op.mutate(openVSwitch.getSchema())
                         .addMutation(openVSwitch.getManagerOptionsColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(TEST_MANAGER_UUID_STR)))
+                                Collections.singleton(new UUID(TEST_MANAGER_UUID_STR)))
                         .where(openVSwitch.getUuidColumn().getSchema().opEqual(openVSwitchRowUuid))
                         .build())
                 .add(op.comment("Open_vSwitch: Mutating " + TEST_MANAGER_UUID_STR));
@@ -565,7 +564,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Manager: Deleting " + TEST_MANAGER_UUID_STR))
                 .add(op.mutate(openVSwitch.getSchema())
                         .addMutation(openVSwitch.getManagerOptionsColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testManagerUuid)))
+                                Collections.singleton(testManagerUuid)))
                 .add(op.comment("Open_vSwitch: Mutating " + TEST_MANAGER_UUID_STR + " " + testManagerUuid))
                 .add(op.commit(true));
 
@@ -601,7 +600,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Mirror: Inserting " + mirrorUuidStr))
                 .add(op.mutate(bridge.getSchema())
                         .addMutation(bridge.getMirrorsColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(mirrorUuidStr)))
+                                Collections.singleton(new UUID(mirrorUuidStr)))
                         .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.comment("Bridge: Mutating " + TEST_BRIDGE_NAME));
@@ -629,7 +628,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Mirror: Deleting " + testMirrorUuid))
                 .add(op.mutate(bridge.getSchema()) // Delete a controller column in the Bridge table
                         .addMutation(bridge.getMirrorsColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testMirrorUuid)))
+                                Collections.singleton(testMirrorUuid)))
                 .add(op.comment("Bridge: Mutating " + testMirrorUuid))
                 .add(op.commit(true));
 
@@ -669,7 +668,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Mirror: Inserting " + netFlowUuidStr))
                 .add(op.mutate(bridge.getSchema())
                         .addMutation(bridge.getNetflowColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(netFlowUuidStr)))
+                                Collections.singleton(new UUID(netFlowUuidStr)))
                         .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.comment("Bridge: Mutating " + TEST_BRIDGE_NAME));
@@ -697,7 +696,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("NetFlow: Deleting " + testNetFlowUuid))
                 .add(op.mutate(bridge.getSchema()) // Delete a controller column in the Bridge table
                         .addMutation(bridge.getNetflowColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testNetFlowUuid)))
+                                Collections.singleton(testNetFlowUuid)))
                 .add(op.comment("Bridge: Mutating " + testNetFlowUuid))
                 .add(op.commit(true));
 
@@ -760,7 +759,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                         .build())
                 .add(op.comment("Interface: Updating " + intfUuidStr))
                 .add(op.mutate(bridge.getSchema())
-                        .addMutation(bridge.getPortsColumn().getSchema(), Mutator.INSERT, Sets.newHashSet(new UUID(portUuidStr)))
+                        .addMutation(bridge.getPortsColumn().getSchema(), Mutator.INSERT, Collections.singleton(new UUID(portUuidStr)))
                         .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.comment("Bridge: Mutating " + TEST_BRIDGE_NAME));
@@ -799,7 +798,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Interface: Deleting " + testInterfaceUuid))
                 .add(op.mutate(bridge.getSchema()) // Delete a port column in the Bridge table
                         .addMutation(bridge.getPortsColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testPortUuid)))
+                                Collections.singleton(testPortUuid)))
                 .add(op.comment("Bridge: Mutating " + testPortUuid))
                 .add(op.commit(true));
 
@@ -837,7 +836,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Autoattach: Inserting " + autoattachUuid))
                 .add(op.mutate(bridge.getSchema())
                         .addMutation(bridge.getAutoAttachColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(autoattachUuid)))
+                                Collections.singleton(new UUID(autoattachUuid)))
                         .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.comment("Bridge: Mutating " + TEST_BRIDGE_NAME));
@@ -866,7 +865,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("AutoAttach: Deleting " + testAutoattachUuid))
                 .add(op.mutate(bridge.getSchema()) // Delete auto_attach column in the Bridge table
                         .addMutation(bridge.getAutoAttachColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testAutoattachUuid)))
+                                Collections.singleton(testAutoattachUuid)))
                 .add(op.comment("Bridge: Mutating " + testAutoattachUuid))
                 .add(op.commit(true));
         executeTransaction(transactionBuilder, "AutoAttach, Bridge auto_attach column: Delete operation results");
@@ -936,7 +935,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Interface: Updating " + intfUuidStr))
                 .add(op.mutate(bridge.getSchema())
                         .addMutation(bridge.getPortsColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(portUuidStr)))
+                                Collections.singleton(new UUID(portUuidStr)))
                         .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.comment("Bridge: Mutating " + TEST_BRIDGE_NAME));
@@ -989,11 +988,11 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Qos: Deleting " + testQosUuid))
                 .add(op.mutate(bridge.getSchema()) // Delete a port column in the Bridge table
                         .addMutation(bridge.getPortsColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testPortUuid)))
+                                Collections.singleton(testPortUuid)))
                 .add(op.comment("Bridge: Mutating " + testPortUuid))
                 .add(op.mutate(port.getSchema()) // Delete a qos column in the Port table
                         .addMutation(port.getQosColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testQosUuid)))
+                                Collections.singleton(testQosUuid)))
                 .add(op.comment("Port: Mutating " + testPortUuid))
                 .add(op.commit(true));
 
@@ -1072,7 +1071,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("Queue: Deleting " + testQueueUuid))
                 .add(op.mutate(qos.getSchema()) // Delete a queue column in the Qos table
                         .addMutation(qos.getQueuesColumn().getSchema(), Mutator.DELETE,
-                                Maps.newHashMap(ImmutableMap.of(0L,testQueueUuid))))
+                                ImmutableMap.of(0L,testQueueUuid)))
                 .add(op.comment("Queue: Mutating " + testQueueUuid))
                 .add(op.commit(true));
 
@@ -1119,7 +1118,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("sFlow: Inserting " + sFlowUuidStr))
                 .add(op.mutate(bridge.getSchema())
                         .addMutation(bridge.getSflowColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(sFlowUuidStr)))
+                                Collections.singleton(new UUID(sFlowUuidStr)))
                         .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                         .build())
                 .add(op.comment("Bridge: Mutating " + TEST_BRIDGE_NAME));
@@ -1147,7 +1146,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("SFlow: Deleting " + testSFlowUuid))
                 .add(op.mutate(bridge.getSchema()) // Delete an sflow column in the Bridge table
                         .addMutation(bridge.getSflowColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testSFlowUuid)))
+                                Collections.singleton(testSFlowUuid)))
                 .add(op.comment("Bridge: Mutating " + testSFlowUuid))
                 .add(op.commit(true));
 
@@ -1189,7 +1188,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("SSL: Inserting " + sslUuidStr))
                 .add(op.mutate(openVSwitch.getSchema())
                         .addMutation(openVSwitch.getSslColumn().getSchema(), Mutator.INSERT,
-                                Sets.newHashSet(new UUID(sslUuidStr)))
+                                Collections.singleton(new UUID(sslUuidStr)))
                         .where(openVSwitch.getUuidColumn().getSchema().opEqual(openVSwitchRowUuid))
                         .build())
                 .add(op.comment("Open_vSwitch: Mutating " + sslUuidStr));
@@ -1218,7 +1217,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
                 .add(op.comment("SSL: Deleting " + testSslUuid))
                 .add(op.mutate(openVSwitch.getSchema())
                         .addMutation(openVSwitch.getSslColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(testSslUuid)))
+                                Collections.singleton(testSslUuid)))
                 .add(op.comment("Open_vSwitch: Mutating " + testSslUuid))
                 .add(op.commit(true));
 
@@ -1237,7 +1236,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
         assertNotNull(bridge);
         bridge.setName(TEST_BRIDGE_NAME);
         bridge.setStatus(ImmutableMap.of("key", "value"));
-        bridge.setFloodVlans(Sets.newHashSet(34L));
+        bridge.setFloodVlans(Collections.singleton(34L));
         assertNotNull(bridge.toString());
 
         Bridge nullRowBridge = getClient().getTypedRowWrapper(Bridge.class, null);
@@ -1250,7 +1249,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
         assertNotNull(bridge);
         bridge.setName(TEST_BRIDGE_NAME);
         bridge.setStatus(ImmutableMap.of("key", "value"));
-        bridge.setFloodVlans(Sets.newHashSet(34L));
+        bridge.setFloodVlans(Collections.singleton(34L));
 
         assertTrue("Equals check on same Bridge object", bridge.equals(bridge));
 
@@ -1281,7 +1280,7 @@ public class OpenVSwitchIT extends LibraryIntegrationTestBase {
         assertNotNull(bridge);
         bridge.setName(TEST_BRIDGE_NAME);
         bridge.setStatus(ImmutableMap.of("key", "value"));
-        bridge.setFloodVlans(Sets.newHashSet(34L));
+        bridge.setFloodVlans(Collections.singleton(34L));
 
         assertNotSame(bridge.hashCode(), 0);
         Bridge nullRowBridge = getClient().getTypedRowWrapper(Bridge.class, null);
index 17925dc5dadf696da56741947b419237b13519f5..9afa559e164a4865e5693903191ac8d699c40b45 100644 (file)
@@ -15,6 +15,7 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 
@@ -36,7 +37,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.ListenableFuture;
 
 @RunWith(PaxExam.class)
@@ -58,10 +58,10 @@ public class LibraryIT extends LibraryIntegrationTestBase {
         Bridge bridge = ovsdbClient.createTypedRowWrapper(Bridge.class);
         bridge.setName(TEST_BRIDGE_NAME);
         bridge.setStatus(ImmutableMap.of("key", "value"));
-        bridge.setFloodVlans(Sets.newHashSet(34L));
+        bridge.setFloodVlans(Collections.singleton(34L));
 
         OpenVSwitch openVSwitch = ovsdbClient.createTypedRowWrapper(OpenVSwitch.class);
-        openVSwitch.setBridges(Sets.newHashSet(new UUID(TEST_BRIDGE_NAME)));
+        openVSwitch.setBridges(Collections.singleton(new UUID(TEST_BRIDGE_NAME)));
 
         int insertOperationIndex = 0;
 
@@ -124,7 +124,7 @@ public class LibraryIT extends LibraryIntegrationTestBase {
                         .build())
                 .add(op.mutate(openVSwitch.getSchema())
                         .addMutation(openVSwitch.getBridgesColumn().getSchema(),
-                                Mutator.DELETE, Sets.newHashSet(testBridgeUuid)))
+                                Mutator.DELETE, Collections.singleton(testBridgeUuid)))
                 .add(op.commit(true))
                 .execute();
 
index 4b56e6ffe36ae08ed7193e6ac88842c99e3bc4a9..6ec0c451c5d7773660e600b367220bb2c92ac874 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2015, 2016 Red Hat, Inc. and others. All rights reserved.
+ * Copyright © 2015, 2017 Red Hat, Inc. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -21,9 +21,9 @@ import static org.ops4j.pax.exam.CoreOptions.vmOption;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
 
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -248,7 +248,7 @@ public abstract class LibraryIntegrationTestBase extends AbstractMdsalTestBase {
 
         assertNotNull(getDbSchema());
 
-        List<MonitorRequest> monitorRequests = Lists.newArrayList();
+        List<MonitorRequest> monitorRequests = new ArrayList<>();
         Set<String> tables = getDbSchema().getTables();
         assertNotNull("ovsdb tables should not be null", tables);
 
index 17dc34b5a5ced0a1c1b839c404e5ca686a1958a8..b6bae02f9da3c8e122e007f5c0d82c9a7d68d3ca 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.ovsdb.southbound;
 
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.ListenableFuture;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -165,7 +165,7 @@ public class OvsdbConnectionInstance {
     private void monitorTables(String database, DatabaseSchema dbSchema) {
         Set<String> tables = dbSchema.getTables();
         if (tables != null) {
-            List<MonitorRequest> monitorRequests = Lists.newArrayList();
+            List<MonitorRequest> monitorRequests = new ArrayList<>();
             for (String tableName : tables) {
                 if (!SouthboundConstants.SKIP_OVSDB_TABLE.contains(tableName)) {
                     LOG.info("Southbound monitoring OVSDB schema table {}", tableName);
index 86fb31159639c074a25e7b051400dea555980891..6c04338797180653e09441a82b50ed3e7bf0413a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Inocybe Technologies and others. All rights reserved.
+ * Copyright © 2016, 2017 Inocybe Technologies and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -11,8 +11,8 @@ package org.opendaylight.ovsdb.southbound.ovsdb.transact;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
@@ -114,7 +114,7 @@ public class AutoAttachRemovedCommand implements TransactCommand {
 
             transaction.add(op.mutate(bridge.getSchema())
                     .addMutation(bridge.getAutoAttachColumn().getSchema(),
-                            Mutator.DELETE, Sets.newHashSet(uuid))
+                            Mutator.DELETE, Collections.singleton(uuid))
                     .where(bridge.getNameColumn().getSchema()
                             .opEqual(bridgeAugmentation.getBridgeName().getValue())).build());
 
index d49cda71b58babfb047746707abb411e9709c474..cde69d5fefe620f2a96f4167802465f784576be8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Inocybe Technologies and others. All rights reserved.
+ * Copyright © 2016, 2017 Inocybe Technologies and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -11,8 +11,8 @@ package org.opendaylight.ovsdb.southbound.ovsdb.transact;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -149,7 +149,7 @@ public class AutoAttachUpdateCommand implements TransactCommand {
                     final OvsdbBridgeAugmentation ovsdbBridgeAugmentation = getBridge(iid, bridgeUri);
                     if (ovsdbBridgeAugmentation != null) {
                         bridge.setName(ovsdbBridgeAugmentation.getBridgeName().getValue());
-                        bridge.setAutoAttach(Sets.newHashSet(new UUID(namedUuid)));
+                        bridge.setAutoAttach(Collections.singleton(new UUID(namedUuid)));
                         LOG.trace("Create Autoattach table {}, and mutate the bridge {}",
                                 autoAttach.getAutoattachId(), getBridge(iid, bridgeUri).getBridgeName().getValue());
                         transaction.add(op.mutate(bridge)
index 514c114d14db98c1ca83295be8b3bde46ba2eda1..b8341e152cfe7b96012beefe35420c231ca59512 100644 (file)
@@ -11,8 +11,8 @@ package org.opendaylight.ovsdb.southbound.ovsdb.transact;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
@@ -68,7 +68,7 @@ public class BridgeRemovedCommand implements TransactCommand {
                 transaction.add(op.comment("Bridge: Deleting " + original.getBridgeName()));
                 transaction.add(op.mutate(ovs.getSchema())
                         .addMutation(ovs.getBridgesColumn().getSchema(), Mutator.DELETE,
-                                Sets.newHashSet(bridgeUuid)));
+                                Collections.singleton(bridgeUuid)));
                 transaction.add(op.comment("Open_vSwitch: Mutating " + original.getBridgeName() + " " + bridgeUuid));
                 LOG.info("Bridge Deleted: {}", ovsdbManagedNodeIid);
             } else {
index 2e419c86973b0005970bdeefad4e293a44f4ac5f..a004bae52f9746ec3576dc737844a6742a3ef88c 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.ovsdb.southbound.ovsdb.transact;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -159,9 +158,9 @@ public class BridgeUpdateCommand implements TransactCommand {
         String portNamedUuid = "Port_" + SouthboundMapper.getRandomUuid();
         Port port = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Port.class);
         port.setName(ovsdbManagedNode.getBridgeName().getValue());
-        port.setInterfaces(Sets.newHashSet(TransactUtils.extractNamedUuid(interfaceInsert)));
+        port.setInterfaces(Collections.singleton(TransactUtils.extractNamedUuid(interfaceInsert)));
         transaction.add(op.insert(port).withId(portNamedUuid));
-        bridge.setPorts(Sets.newHashSet(new UUID(portNamedUuid)));
+        bridge.setPorts(Collections.singleton(new UUID(portNamedUuid)));
     }
 
     private Insert<GenericTableSchema> setInterface(TransactionBuilder transaction,
@@ -180,7 +179,7 @@ public class BridgeUpdateCommand implements TransactCommand {
             OvsdbBridgeAugmentation ovsdbManagedNode) {
         if (ovsdbManagedNode.getFailMode() != null
                 && SouthboundConstants.OVSDB_FAIL_MODE_MAP.get(ovsdbManagedNode.getFailMode()) != null) {
-            bridge.setFailMode(Sets.newHashSet(
+            bridge.setFailMode(Collections.singleton(
                     SouthboundConstants.OVSDB_FAIL_MODE_MAP.get(ovsdbManagedNode.getFailMode())));
         }
     }
index 64de5cb83de67301790acd7455d25387dbee7ed0..7e345a01642683d8f7f6c67f91a7dd655ea7b2f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright © 2014, 2017 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,8 +10,8 @@ package org.opendaylight.ovsdb.southbound.ovsdb.transact;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
@@ -61,7 +61,7 @@ public class ControllerRemovedCommand implements TransactCommand {
             if (ovsdbBridge != null && controllerEntryOptional.isPresent()) {
                 ControllerEntry controllerEntry = controllerEntryOptional.get();
                 Bridge bridge = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Bridge.class);
-                bridge.setController(Sets.newHashSet(new UUID(controllerEntry.getControllerUuid().getValue())));
+                bridge.setController(Collections.singleton(new UUID(controllerEntry.getControllerUuid().getValue())));
                 transaction.add(op.mutate(bridge).addMutation(bridge.getControllerColumn().getSchema(),
                         Mutator.DELETE, bridge.getControllerColumn().getData()));
             }
index 416a1be71a651e8dcbc51368076bdfc2ee97c497..336f596b033d9ca2be1ce032f0d7cad77e2b0cc3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright © 2014, 2017 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,8 +10,8 @@ package org.opendaylight.ovsdb.southbound.ovsdb.transact;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 import java.util.Map.Entry;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
@@ -73,10 +73,10 @@ public class ControllerUpdateCommand implements TransactCommand {
                             TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Controller.class);
                     controller.setTarget(controllerEntry.getTarget().getValue());
                     if (controllerEntry.getMaxBackoff() != null) {
-                        controller.setMaxBackoff(Sets.newHashSet(controllerEntry.getMaxBackoff()));
+                        controller.setMaxBackoff(Collections.singleton(controllerEntry.getMaxBackoff()));
                     }
                     if (controllerEntry.getInactivityProbe() != null) {
-                        controller.setInactivityProbe(Sets.newHashSet(controllerEntry.getInactivityProbe()));
+                        controller.setInactivityProbe(Collections.singleton(controllerEntry.getInactivityProbe()));
                     }
                     String controllerNamedUuidString = SouthboundMapper.getRandomUuid();
                     UUID controllerNamedUuid = new UUID(controllerNamedUuidString);
@@ -84,7 +84,7 @@ public class ControllerUpdateCommand implements TransactCommand {
 
                     Bridge bridge = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Bridge.class);
                     bridge.setName(ovsdbBridge.getBridgeName().getValue());
-                    bridge.setController(Sets.newHashSet(controllerNamedUuid));
+                    bridge.setController(Collections.singleton(controllerNamedUuid));
                     LOG.trace("Added controller : {} for bridge : {}",
                             controller.getTargetColumn(), bridge.getName());
                     transaction.add(op.mutate(bridge)
index f45774ac5599cf72224cd9b1144e015082125fcd..aadfb785d13270dc570a1c5a3aa4a292a0c0311c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright © 2015, 2017 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,8 +10,8 @@ package org.opendaylight.ovsdb.southbound.ovsdb.transact;
 
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
-import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
@@ -46,7 +46,7 @@ public class OpenVSwitchBridgeAddCommand implements TransactCommand {
         List<Insert> inserts = TransactUtils.extractInsert(transaction, bridge.getSchema());
         for (Insert insert : inserts) {
             OpenVSwitch ovs = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), OpenVSwitch.class);
-            ovs.setBridges(Sets.newHashSet(TransactUtils.extractNamedUuid(insert)));
+            ovs.setBridges(Collections.singleton(TransactUtils.extractNamedUuid(insert)));
             transaction.add(op.mutate(ovs).addMutation(ovs.getBridgesColumn().getSchema(),
                     Mutator.INSERT,
                     ovs.getBridgesColumn().getData()));
index c1db8d6a88c10afd7b994de03c432405ac029a80..281776a8a10beeadf9ab3e60ac7628d8fda36d5a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright © 2015, 2017 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -12,8 +12,8 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
@@ -67,7 +67,7 @@ public class ProtocolRemovedCommand implements TransactCommand {
                     Bridge bridge = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Bridge.class);
                     String protocolString = SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocolEntry.getProtocol());
                     if (protocolString != null) {
-                        bridge.setProtocols(Sets.newHashSet(protocolString));
+                        bridge.setProtocols(Collections.singleton(protocolString));
                         try {
                             transaction.add(op.mutate(bridge).addMutation(bridge.getProtocolsColumn().getSchema(),
                                     Mutator.DELETE,bridge.getProtocolsColumn().getData()));
index 9efbc33983957470f6aecb88025098b8cbf4c510..9ecd38f00c25818cb4ff940906054f743936bcf6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright © 2015, 2017 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -12,8 +12,8 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 import java.util.Map.Entry;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
@@ -78,7 +78,7 @@ public class ProtocolUpdateCommand implements TransactCommand {
                         Bridge bridge = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Bridge.class);
                         bridge.setName(ovsdbBridge.getBridgeName().getValue());
                         try {
-                            bridge.setProtocols(Sets.newHashSet(protocolString));
+                            bridge.setProtocols(Collections.singleton(protocolString));
                             transaction.add(op.mutate(bridge).addMutation(bridge.getProtocolsColumn().getSchema(),
                                         Mutator.INSERT,bridge.getProtocolsColumn().getData())
                                 .where(bridge.getNameColumn().getSchema().opEqual(bridge.getNameColumn().getData()))
index ae62bf070000dab1cbe0535118dc396aef30b64d..2014a1db14f88a232497e42398dac9e6413f176b 100644 (file)
@@ -11,7 +11,6 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.CheckedFuture;
 import java.util.Collection;
 import java.util.Collections;
@@ -114,7 +113,7 @@ public class TerminationPointCreateCommand implements TransactCommand {
                 Bridge bridge = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Bridge.class);
                 if (getBridge(entry.getKey(), nodes) != null) {
                     bridge.setName(getBridge(entry.getKey(), nodes).getBridgeName().getValue());
-                    bridge.setPorts(Sets.newHashSet(new UUID(portUuid)));
+                    bridge.setPorts(Collections.singleton(new UUID(portUuid)));
 
                     transaction.add(op.mutate(bridge)
                             .addMutation(bridge.getPortsColumn().getSchema(),
@@ -156,7 +155,7 @@ public class TerminationPointCreateCommand implements TransactCommand {
             final Port port, final String interfaceUuid) {
 
         port.setName(terminationPoint.getName());
-        port.setInterfaces(Sets.newHashSet(new UUID(interfaceUuid)));
+        port.setInterfaces(Collections.singleton(new UUID(interfaceUuid)));
         createPortOtherConfig(terminationPoint, port);
         createPortVlanTag(terminationPoint, port);
         createPortVlanTrunk(terminationPoint, port);
@@ -170,7 +169,7 @@ public class TerminationPointCreateCommand implements TransactCommand {
 
         Long ofPort = terminationPoint.getOfport();
         if (ofPort != null) {
-            ovsInterface.setOpenFlowPort(Sets.newHashSet(ofPort));
+            ovsInterface.setOpenFlowPort(Collections.singleton(ofPort));
         }
     }
 
@@ -180,7 +179,7 @@ public class TerminationPointCreateCommand implements TransactCommand {
 
         Integer ofPortRequest = terminationPoint.getOfportRequest();
         if (ofPortRequest != null) {
-            ovsInterface.setOpenFlowPortRequest(Sets.newHashSet(ofPortRequest.longValue()));
+            ovsInterface.setOpenFlowPortRequest(Collections.singleton(ofPortRequest.longValue()));
         }
     }
 
index d8adae70e4de950d7c959cb755ca8f6945cc16fa..70a884c8b5e5ac212bd49de202da93820f4c08d9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ * Copyright © 2015, 2017 Brocade Communications Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,8 +10,8 @@ package org.opendaylight.ovsdb.southbound.ovsdb.transact;
 import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
@@ -100,7 +100,7 @@ public class TerminationPointDeleteCommand implements TransactCommand {
 
                     transaction.add(op.mutate(bridge.getSchema())
                             .addMutation(bridge.getPortsColumn().getSchema(),
-                                    Mutator.DELETE, Sets.newHashSet(portUuid))
+                                    Mutator.DELETE, Collections.singleton(portUuid))
                             .where(bridge.getNameColumn().getSchema().opEqual(bridgeName)).build());
 
                     transaction.add(op.comment("Bridge: Mutating " + bridgeName
index 81a49c36580f6dedc27316a84b0e5028647f5714..7ffc21f258a99268622b8dd9b33d20d18e9d67da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ * Copyright © 2015, 2017 Brocade Communications Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -11,9 +11,9 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
 
 import com.google.common.base.Optional;
-import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.CheckedFuture;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -168,7 +168,7 @@ public class TerminationPointUpdateCommand implements TransactCommand {
             final Port port,
             final OvsdbBridgeAugmentation operBridge) {
 
-        Set<UUID> uuidSet = Sets.newHashSet();
+        Set<UUID> uuidSet = new HashSet<>();
 
         // First check if QosEntry is present and use that
         if (terminationPoint.getQosEntry() != null && !terminationPoint.getQosEntry().isEmpty()) {
@@ -222,7 +222,7 @@ public class TerminationPointUpdateCommand implements TransactCommand {
 
         Long ofPort = terminationPoint.getOfport();
         if (ofPort != null) {
-            ovsInterface.setOpenFlowPort(Sets.newHashSet(ofPort));
+            ovsInterface.setOpenFlowPort(Collections.singleton(ofPort));
         }
     }
 
@@ -232,7 +232,7 @@ public class TerminationPointUpdateCommand implements TransactCommand {
 
         Integer ofPortRequest = terminationPoint.getOfportRequest();
         if (ofPortRequest != null) {
-            ovsInterface.setOpenFlowPortRequest(Sets.newHashSet(ofPortRequest.longValue()));
+            ovsInterface.setOpenFlowPortRequest(Collections.singleton(ofPortRequest.longValue()));
         }
     }
 
index 2b03960540bfefe828f59bff492489ae6a224c29..eb425d2010585fa1dc62705871a649294a3d06c8 100644 (file)
@@ -11,11 +11,10 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 
 import com.google.common.base.Predicates;
 import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -443,8 +442,9 @@ public class TransactUtils {
                     externalIdsMap);
         Mutation deleteIidMutation = new Mutation(columnSchema.getName(),
                 Mutator.DELETE,
-                OvsdbSet.fromSet(Sets.newHashSet(SouthboundConstants.IID_EXTERNAL_ID_KEY)));
-        List<Mutation> mutations = Lists.newArrayList(Sets.newHashSet(deleteIidMutation));
+                OvsdbSet.fromSet(Collections.singleton(SouthboundConstants.IID_EXTERNAL_ID_KEY)));
+        List<Mutation> mutations = new ArrayList<>();
+        mutations.add(deleteIidMutation);
         mutations.addAll(mutate.getMutations());
         mutate.setMutations(mutations);
         return mutate;
index b9a6fa3d93411ac934c515adce93f24ae5f40560..08e276a902b42209a6744f72fe2c2fd2693330bc 100644 (file)
@@ -808,7 +808,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
         entry.addAugmentation(
                 OvsdbTerminationPointAugmentation.class,
                 ovsdbTerminationPointAugmentationBuilder.build());
-        portNodeBuilder.setTerminationPoint(Lists.newArrayList(entry.build()));
+        portNodeBuilder.setTerminationPoint(Collections.singletonList(entry.build()));
         boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
                 portIid, portNodeBuilder.build());
         Thread.sleep(OVSDB_UPDATE_TIMEOUT);
@@ -1512,7 +1512,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                     tpUpdateBuilder.addAugmentation(
                             OvsdbTerminationPointAugmentation.class,
                             tpUpdateAugmentationBuilder.build());
-                    portUpdateNodeBuilder.setTerminationPoint(Lists.newArrayList(tpUpdateBuilder.build()));
+                    portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
                     Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
                             portIid, portUpdateNodeBuilder.build()));
                     Thread.sleep(OVSDB_UPDATE_TIMEOUT);
@@ -1746,7 +1746,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                     OvsdbTerminationPointAugmentation.class,
                     tpUpdateAugmentationBuilder.build());
             tpUpdateBuilder.setTpId(new TpId(portName));
-            portUpdateNodeBuilder.setTerminationPoint(Lists.newArrayList(tpUpdateBuilder.build()));
+            portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
             Assert.assertTrue(
                     mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, portIid, portUpdateNodeBuilder.build()));
             Thread.sleep(OVSDB_UPDATE_TIMEOUT);
@@ -1816,7 +1816,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                         OvsdbTerminationPointAugmentation.class,
                         tpUpdateAugmentationBuilder.build());
                 tpUpdateBuilder.setTpId(new TpId(portName));
-                portUpdateNodeBuilder.setTerminationPoint(Lists.newArrayList(tpUpdateBuilder.build()));
+                portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
                 Assert.assertTrue(
                         mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, portIid, portUpdateNodeBuilder.build()));
                 Thread.sleep(OVSDB_UPDATE_TIMEOUT);
@@ -1843,12 +1843,12 @@ public class SouthboundIT extends AbstractMdsalTestBase {
         int max = 4095;
         return Lists.newArrayList(
                 Collections.<Integer>emptySet(),
-                Sets.newHashSet(2222),
+                Collections.singleton(2222),
                 Sets.newHashSet(min, max, min + 1, max - 1, (max - min) / 2));
     }
 
     private List<Trunks> buildTrunkList(Set<Integer> trunkSet) {
-        List<Trunks> trunkList = Lists.newArrayList();
+        List<Trunks> trunkList = new ArrayList<>();
         for (Integer trunk : trunkSet) {
             TrunksBuilder trunkBuilder = new TrunksBuilder();
             trunkBuilder.setTrunk(new VlanId(trunk));
@@ -1859,7 +1859,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
 
     @Test
     public void testCRUDTerminationPointVlanTrunks() throws InterruptedException {
-        final List<Trunks> UPDATED_TRUNKS = buildTrunkList(Sets.newHashSet(2011));
+        final List<Trunks> UPDATED_TRUNKS = buildTrunkList(Collections.singleton(2011));
         ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber);
         Iterable<Set<Integer>> vlanSets = generateVlanSets();
         int testCase = 0;
@@ -1910,7 +1910,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                         OvsdbTerminationPointAugmentation.class,
                         tpUpdateAugmentationBuilder.build());
                 tpUpdateBuilder.setTpId(new TpId(portName));
-                portUpdateNodeBuilder.setTerminationPoint(Lists.newArrayList(tpUpdateBuilder.build()));
+                portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
                 Assert.assertTrue(
                         mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, portIid, portUpdateNodeBuilder.build()));
                 Thread.sleep(OVSDB_UPDATE_TIMEOUT);