Ok, I'm fine with what you have here.
thanks
Tony
On 07/09/2018 05:42 PM, Valerie Peng wrote:
Hi Tony,
The purpose of the if-block is to ensure that
ArrayIndexOutOfBoundsException is thrown instead of
IndexOutOfBoundsException. Objects.checkFromIndexSize(...) API is
specified to throw IndexOutOfBoundsException which is more general and
can be thrown when an index of some sort (such as to an array, to a
string, or to a vector) is out of range. ArrayIndexOutOfBoundsException
is a subclass of IndexOutOfBoundsException and is for array index out of
bounds.
Thanks,
Valerie
On 7/9/2018 3:14 PM, Anthony Scarpino wrote:
On 07/03/2018 02:03 PM, Valerie Peng wrote:
Hi Tony,
Would you have time to review this? Instead of doing the bounds check
per block, the changes move the bounds check up one level.
Bug: https://bugs.openjdk.java.net/browse/JDK-8179098
Webrev: http://cr.openjdk.java.net/~valeriep/8179098/webrev.00/
Thanks,
Valerie
ArrayUtil.java: Line 48
- It seems like your not throwing any ArrayIndexOutOfBoundsExceptions,
is that intentional? The method in the try-catch seems to only throw
IndexOutOfBoundsException, whole if() seems confusing to me.
thanks
Tony