commit | 5c3fd7083c5f6ec54f510248c07eae7e69fb285e | [log] [tgz] |
---|---|---|
author | Thomas Vachuska <tom@onlab.us> | Fri May 01 11:16:53 2015 -0700 |
committer | Gerrit Code Review <gerrit@onlab.us> | Fri May 01 19:36:50 2015 +0000 |
tree | 5c9464e9590da6b19615189446c31970c716d643 | |
parent | 615361e5f36265a427a94ba56c3fa7388497fb30 [diff] |
Fixed IoB exception in null provider. Change-Id: I1e2e6ef7068d5e251f30ac6c10d17f24f611124a
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/NullPacketProvider.java b/providers/null/src/main/java/org/onosproject/provider/nil/NullPacketProvider.java index 674b33f..07a137e 100644 --- a/providers/null/src/main/java/org/onosproject/provider/nil/NullPacketProvider.java +++ b/providers/null/src/main/java/org/onosproject/provider/nil/NullPacketProvider.java
@@ -137,7 +137,7 @@ @Override public void run(Timeout to) { if (!devices.isEmpty() && !to.isCancelled()) { - sendEvent(devices.get(Math.max(currentDevice, devices.size()))); + sendEvent(devices.get(Math.min(currentDevice, devices.size() - 1))); currentDevice = (currentDevice + 1) % devices.size(); timeout = timer.newTimeout(to.getTask(), delay, TimeUnit.MILLISECONDS); }