Update MRI projects for Aluminium
[openflowplugin.git] / applications / bulk-o-matic / src / main / java / org / opendaylight / openflowplugin / applications / bulk / o / matic / FlowWriterDirectOFRpc.java
index 7ad33aba253b8b0a018624aff7a49eefb8b13c33..7755fcf44cb1ab83536dccbffbb657b57bcfa7b0 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.openflowplugin.applications.bulk.o.matic;
 
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.ExecutionException;
@@ -77,8 +77,8 @@ public class FlowWriterDirectOFRpc {
         try (ReadTransaction readOnlyTransaction = dataBroker.newReadOnlyTransaction()) {
             Optional<Nodes> nodesDataNode = readOnlyTransaction.read(LogicalDatastoreType.OPERATIONAL, nodes).get();
             if (nodesDataNode.isPresent()) {
-                List<Node> nodesCollection = nodesDataNode.get().getNode();
-                if (nodesCollection != null && !nodesCollection.isEmpty()) {
+                Collection<Node> nodesCollection = nodesDataNode.get().nonnullNode().values();
+                if (!nodesCollection.isEmpty()) {
                     for (Node node : nodesCollection) {
                         LOG.info("Switch with ID {} discovered !!", node.getId().getValue());
                         nodeIds.add(node.getId().getValue());
@@ -132,7 +132,7 @@ public class FlowWriterDirectOFRpc {
 
                 AddFlowInput addFlowInput = builder.build();
 
-                LOG.debug("RPC invocation for adding flow-id {} with input {}", flowId, addFlowInput.toString());
+                LOG.debug("RPC invocation for adding flow-id {} with input {}", flowId, addFlowInput);
                 LoggingFutures.addErrorLogging(flowService.addFlow(addFlowInput), LOG, "addFlow");
 
                 if (i % batchSize == 0) {