Files
Tagir Valeevandintellij-monorepo-bot a4905164a8 Handle ArrayIndexOutOfBoundsException if we are always out of bounds.
Fixes IDEA-246054 Incorrect condition is always true due to ignored ArrayIndexOutOfBounds catch

GitOrigin-RevId: 4d783f58e587e9cede2e63813583baaec5ece3bd
2020-07-20 08:34:18 +00:00

12 lines
208 B
Java

class X {
// IDEA-246054
void test(int[] data) {
for (int i = -1; i < data.length; i++) {
try {
data[i] = 0;
} catch (ArrayIndexOutOfBoundsException ignored) {
}
}
}
}