This array access might be out of bounds, as the index might be equal to the array length. code example
Example: how to fix Index 2 out of bounds for length 2 when looping through an array in java
1
2
3
for (int i = 0; i < a.length; i++) { // GOOD
sum += a[i];
}