ONOS-4975 Fixed potential for IOB exception in intent perf installer.

Change-Id: Ia0af1dbbad586a4c64883e20b80cb1ffbe251cd4
This commit is contained in:
Thomas Vachuska 2016-08-01 10:19:51 -07:00 committed by Gerrit Code Review
parent 682c19e562
commit 3a02cdabf2

View File

@ -425,7 +425,7 @@ public class IntentPerfInstaller {
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.