Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8203529 | 11.0.1 | Goetz Lindenmaier | P4 | Resolved | Fixed | team |
To analyse ArrayIndexOutOfBounds exceptions it's useful to know the length of the array accessed.
Example for load from / store to array with illegal index:
int[] a = new int[3];
a[7];
Message before:
7
Message now:
Index 7 out of bounds for length 3
arraycopy() also reports ArrayIndexOutOfBoundsExceptions.
Before, it did not report any context for the exception. Now it says:
arraycopy: source index -17 out of bounds for boolean[10]
arraycopy: destination index -18 out of bounds for byte[5]
arraycopy: last source index 13 out of bounds for char[10]
arraycopy: last destination index 7 out of bounds for object array[5]
arraycopy: length -19 is negative
It was agreed to spell "out of bounds" with hyphens if used as an adjective, else without, which is the case here. See also 8202745.
Example for load from / store to array with illegal index:
int[] a = new int[3];
a[7];
Message before:
7
Message now:
Index 7 out of bounds for length 3
arraycopy() also reports ArrayIndexOutOfBoundsExceptions.
Before, it did not report any context for the exception. Now it says:
arraycopy: source index -17 out of bounds for boolean[10]
arraycopy: destination index -18 out of bounds for byte[5]
arraycopy: last source index 13 out of bounds for char[10]
arraycopy: last destination index 7 out of bounds for object array[5]
arraycopy: length -19 is negative
It was agreed to spell "out of bounds" with hyphens if used as an adjective, else without, which is the case here. See also 8202745.
- backported by
-
JDK-8203529 Print array length in ArrayIndexOutOfBoundsException.
-
- Resolved
-
- relates to
-
JDK-8202745 Remove hyphens from "out-of-bounds".
-
- Resolved
-
-
JDK-8217628 Verbose ArrayIndexOutOfBoundsException message also in JNI calls.
-
- Resolved
-
-
JDK-8203189 [Graal] org.graalvm.compiler.jtt.except tests fail due to ArrayIndexOutOfBoundsException message change
-
- Resolved
-
-
JDK-8204606 [Aarch64] SIGSEGVs caused by C1 because of improper register usage
-
- Closed
-
-
JDK-8259961 Exception message from arraycopy in JDK 11.0.5 is different from OpenJDK 8u232
-
- Closed
-
(1 relates to)