8135248 and 8155794 introduced utility methods for checking indexes and ranges. Existing code with custom checkIndex/checkRange can be updated to use these methods. Please review the patch for this purpose:

bug: https://bugs.openjdk.java.net/browse/JDK-8146668
webrev: http://cr.openjdk.java.net/~amlu/8146668/webrev.01

The type of exception thrown are preserved. Custom checkIndex/checkRange functions that throw IOOBE are now using ‘check’ utility methods provided by java.lang.Objects (which also throws IOOBE), functions that throw other exceptions use jdk.internal.util.Preconditions to preserve exception types, with the help of new BiFunction vars.

I'd like to get this in JDK 9 if it's not too late, otherwise, JDK 10.

Thanks,
Amy

Reply via email to