mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Merge pull request #2343 from jordanorelli/master
fixes #2341 - inconsistent bounds checks
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user