commit | 3a02cdabf20ecf01b5a4e76a812ceb07927f53b0 | [log] [tgz] |
---|---|---|
author | Thomas Vachuska <tom@onlab.us> | Mon Aug 01 10:19:51 2016 -0700 |
committer | Gerrit Code Review <gerrit@onlab.us> | Tue Aug 02 16:53:53 2016 +0000 |
tree | b41d670d39829b6de5231e83fc76e2b710555a9e | |
parent | 682c19e5629e1848c62407b1f57e5a241bb12186 [diff] |
ONOS-4975 Fixed potential for IOB exception in intent perf installer. Change-Id: Ia0af1dbbad586a4c64883e20b80cb1ffbe251cd4
diff --git a/apps/test/intent-perf/src/main/java/org/onosproject/intentperf/IntentPerfInstaller.java b/apps/test/intent-perf/src/main/java/org/onosproject/intentperf/IntentPerfInstaller.java index e839fde..104d9c7 100644 --- a/apps/test/intent-perf/src/main/java/org/onosproject/intentperf/IntentPerfInstaller.java +++ b/apps/test/intent-perf/src/main/java/org/onosproject/intentperf/IntentPerfInstaller.java
@@ -425,7 +425,7 @@ private Iterable<Intent> subset(Set<Intent> intents) { List<Intent> subset = Lists.newArrayList(intents); Collections.shuffle(subset); - return subset.subList(0, lastCount); + return subset.subList(0, Math.min(intents.size(), lastCount)); } // Submits the specified intent.