Thomas Vachuska
Committed by Gerrit Code Review

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

Change-Id: Ia0af1dbbad586a4c64883e20b80cb1ffbe251cd4
......@@ -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.
......