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 { ...@@ -425,7 +425,7 @@ public class IntentPerfInstaller {
425 private Iterable<Intent> subset(Set<Intent> intents) { 425 private Iterable<Intent> subset(Set<Intent> intents) {
426 List<Intent> subset = Lists.newArrayList(intents); 426 List<Intent> subset = Lists.newArrayList(intents);
427 Collections.shuffle(subset); 427 Collections.shuffle(subset);
428 - return subset.subList(0, lastCount); 428 + return subset.subList(0, Math.min(intents.size(), lastCount));
429 } 429 }
430 430
431 // Submits the specified intent. 431 // Submits the specified intent.
......