Merge pull request #2343 from jordanorelli/master

fixes #2341 - inconsistent bounds checks
This commit is contained in:
Ben Fry
2014-07-30 12:36:00 -04:00
3 changed files with 9 additions and 0 deletions
+3
View File
@@ -110,6 +110,9 @@ public class FloatList implements Iterable<Float> {
* @brief Get an entry at a particular index
*/
public float get(int index) {
if (index >= count) {
throw new ArrayIndexOutOfBoundsException(index);
}
return data[index];
}
+3
View File
@@ -130,6 +130,9 @@ public class IntList implements Iterable<Integer> {
* @brief Get an entry at a particular index
*/
public int get(int index) {
if (index >= this.count) {
throw new ArrayIndexOutOfBoundsException(index);
}
return data[index];
}
+3
View File
@@ -113,6 +113,9 @@ public class StringList implements Iterable<String> {
* @brief Get an entry at a particular index
*/
public String get(int index) {
if (index >= count) {
throw new ArrayIndexOutOfBoundsException(index);
}
return data[index];
}