mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8268698: Use Objects.check{Index,FromToIndex,FromIndexSize} for java.base
Reviewed-by: mchung, rriggs
This commit is contained in:
parent
a4e5f08fef
commit
afe957cd97
40 changed files with 186 additions and 284 deletions
|
@ -109,12 +109,9 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase {
|
|||
return at.accessModeType(byte[].class, $type$.class, int.class);
|
||||
}
|
||||
|
||||
private static final BiFunction<String, List<Number>, ArrayIndexOutOfBoundsException>
|
||||
OOBEF = Preconditions.outOfBoundsExceptionFormatter(ArrayIndexOutOfBoundsException::new);
|
||||
|
||||
@ForceInline
|
||||
static int index(byte[] ba, int index) {
|
||||
return Preconditions.checkIndex(index, ba.length - ALIGN, OOBEF);
|
||||
return Preconditions.checkIndex(index, ba.length - ALIGN, Preconditions.AIOOBE_FORMATTER);
|
||||
}
|
||||
|
||||
@ForceInline
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue