Fix NPE in FlowProgrammerService in openflow plugin
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / TableStatisticsConverter.java
index 993f8976fc6299fc3d0bece5d49da0d30432c64d..bcc2445808a677573892b299b16a3a2d6a5beed8 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.protocol_plugin.openflow.internal;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import org.opendaylight.controller.sal.core.Node;
@@ -33,7 +34,7 @@ public class TableStatisticsConverter {
     public TableStatisticsConverter(long switchId, List<OFStatistics> statsList) {
         this.switchId = switchId;
         if (statsList == null || statsList.isEmpty()) {
-            this.ofStatsList = new ArrayList<OFStatistics>(1); // dummy list
+            this.ofStatsList = Collections.emptyList();
         } else {
             this.ofStatsList = new ArrayList<OFStatistics>(statsList);
         }