commit | 7772af00a7455b1e70bbf1eafffb1a2e3b86e9de | [log] [tgz] |
---|---|---|
author | Jon Hall <jhall@onlab.us> | Wed Apr 29 17:22:25 2015 -0700 |
committer | Gerrit Code Review <gerrit@onlab.us> | Thu Apr 30 19:25:22 2015 +0000 |
tree | 4c4f7a244acab9c290b150ab8feac36775c2b9b0 | |
parent | dfc639e6a2be23f123a7a21be283d9e274ceb3db [diff] |
Fix for missing case in set test cli -Also avoid bug in toArray by using the current set size Change-Id: Ie838b9fe755859a1cb5af11934f29049466eb93f
diff --git a/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestGetCommand.java b/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestGetCommand.java index 19d3216..792eab9 100644 --- a/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestGetCommand.java +++ b/apps/test/distributed-primitives/src/main/java/org/onosproject/distributedprimitives/cli/SetTestGetCommand.java
@@ -74,7 +74,7 @@ if (set.isEmpty()) { print("[]"); } else { - for (String e : set.toArray(new String[0])) { + for (String e : set.toArray(new String[set.size()])) { if (output.isEmpty()) { output += e; } else { @@ -84,7 +84,9 @@ print("[%s]", output); } // Check if given values are in the set - if (values.length == 1) { + if (values == null) { + return; + } else if (values.length == 1) { // contains if (set.contains(values[0])) { print("Set %s contains the value %s", setName, values[0]);