mirror of
https://github.com/processing/processing4.git
synced 2026-05-28 11:08:06 +02:00
6f2b4ce9a9
The core datastructure IntLost, FloatList, and StringList all have
unsafe .get methods that do not perform bounds checking. This is in
contrast to their .remove methods, which do perform bounds checking.
Prior to this patch, the following would print 0:
IntList il = new IntList();
println(il.get(5));
But if we tried to *remove* that element, we would get an
ArrayIndexOutOfBoundException:
il.remove(5);
This patch causes calls to .get to throw exceptions instead of returning
0 (or null in the case of StringList) for uninitialized values.