commit | 6601dd7c2dd1d5c844820a15aac85d947fa56613 | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Mon May 11 19:00:29 2015 -0700 |
committer | Gerrit Code Review <gerrit@onlab.us> | Tue May 12 19:11:27 2015 +0000 |
tree | 25a702bba2789c53131e0b08086d01b51678a502 | |
parent | baddcbe3eed2f3dc04086dc22806309b6de11088 [diff] |
Return Collections.emptyList() instead of null to avoid NullPointerException Change-Id: I763a6d8993e32e2203c9e3be317d3db3e893d886
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java index 698c77c..ee51e7d 100644 --- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java +++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
@@ -186,11 +186,12 @@ } private List<OFAction> buildActions(List<Instruction> treatments) { - List<OFAction> actions = new LinkedList<>(); - boolean tableFound = false; if (treatment == null) { - return actions; + return Collections.emptyList(); } + + boolean tableFound = false; + List<OFAction> actions = new LinkedList<>(); for (Instruction i : treatments) { switch (i.type()) { case DROP: @@ -230,7 +231,7 @@ if (tableFound && actions.isEmpty()) { // handles the case where there are no actions, but there is // a goto instruction for the next table - return null; + return Collections.emptyList(); } return actions; }