-
Type:
Enhancement
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: None
-
Component/s: core-libs
-
b13
-
generic
-
generic
A number of bounds checks are performed in the $Type$Buffer classes using the package-scope method java.nio.Buffer.checkBounds() which has an empty message:
static void checkBounds(int off, int len, int size) { // package-private
if ((off | len | (off + len) | (size - (off + len))) < 0)
throw new IndexOutOfBoundsException();
}
It would be better to have some more information on what failed, for example, to use java.util.Objects.checkFromIndexSize() instead.
static void checkBounds(int off, int len, int size) { // package-private
if ((off | len | (off + len) | (size - (off + len))) < 0)
throw new IndexOutOfBoundsException();
}
It would be better to have some more information on what failed, for example, to use java.util.Objects.checkFromIndexSize() instead.
- links to