Merge branch 'master' of https://github.com/OPENNETWORKINGLAB/ONOS
diff --git a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
index 320d114..405af1a 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
@@ -906,13 +906,13 @@
// the flows as appropriate.
//
ArrayList<FlowPath> allFlows = getAllFlows();
+ ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
if (allFlows == null) {
log.debug("Get FlowPaths for installerId{} and dataPathEndpoints{}: no FlowPaths found", installerId, dataPathEndpoints);
- return null;
+ return flowPaths;
}
- ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
for (FlowPath flow : allFlows) {
//
// TODO: String-based comparison is sub-optimal.
@@ -932,7 +932,6 @@
if (flowPaths.isEmpty()) {
log.debug("Get FlowPaths for installerId{} and dataPathEndpoints{}: no FlowPaths found", installerId, dataPathEndpoints);
- flowPaths = null;
} else {
log.debug("Get FlowPaths for installerId{} and dataPathEndpoints{}: FlowPaths are found", installerId, dataPathEndpoints);
}
@@ -955,14 +954,14 @@
// We should use the appropriate Titan/Gremlin query to filter-out
// the flows as appropriate.
//
- ArrayList<FlowPath> allFlows = getAllFlows();
+ ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
+ ArrayList<FlowPath> allFlows = getAllFlows();
if (allFlows == null) {
log.debug("Get FlowPaths for dataPathEndpoints{}: no FlowPaths found", dataPathEndpoints);
- return null;
+ return flowPaths;
}
- ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
for (FlowPath flow : allFlows) {
//
// TODO: String-based comparison is sub-optimal.
@@ -980,7 +979,6 @@
if (flowPaths.isEmpty()) {
log.debug("Get FlowPaths for dataPathEndpoints{}: no FlowPaths found", dataPathEndpoints);
- flowPaths = null;
} else {
log.debug("Get FlowPaths for dataPathEndpoints{}: FlowPaths are found", dataPathEndpoints);
}
@@ -1004,16 +1002,17 @@
// We should use the appropriate Titan/Gremlin query to filter-out
// the flows as appropriate.
//
- ArrayList<FlowPath> allFlows = getAllFlows();
+ ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
+
+ ArrayList<FlowPath> allFlows = getAllFlows();
if (allFlows == null) {
log.debug("Get FlowPathsSummary for {} {}: no FlowPaths found", flowId, maxFlows);
- return null;
+ return flowPaths;
}
Collections.sort(allFlows);
- ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
for (FlowPath flow : allFlows) {
// start from desired flowId
@@ -1035,7 +1034,6 @@
if (flowPaths.isEmpty()) {
log.debug("Get FlowPathsSummary {} {}: no FlowPaths found", flowId, maxFlows);
- flowPaths = null;
} else {
log.debug("Get FlowPathsSummary for {} {}: FlowPaths were found", flowId, maxFlows);
}
@@ -1051,6 +1049,7 @@
@Override
public ArrayList<FlowPath> getAllFlows() {
Iterable<IFlowPath> flowPathsObj = null;
+ ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
try {
if ((flowPathsObj = conn.utils().getAllFlowPaths(conn)) != null) {
@@ -1065,10 +1064,9 @@
}
if ((flowPathsObj == null) || (flowPathsObj.iterator().hasNext() == false)) {
conn.endTx(Transaction.COMMIT);
- return null; // No Flows found
+ return flowPaths; // No Flows found
}
- ArrayList<FlowPath> flowPaths = new ArrayList<FlowPath>();
for (IFlowPath flowObj : flowPathsObj) {
//
// Extract the Flow state