mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +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
|
@ -189,15 +189,4 @@ class MethodHandleStatics {
|
|||
if (obj != null || obj2 != null) message = message + ": " + obj + ", " + obj2;
|
||||
return message;
|
||||
}
|
||||
/*non-public*/
|
||||
static void rangeCheck2(int start, int end, int size) {
|
||||
if (0 > start || start > end || end > size)
|
||||
throw new IndexOutOfBoundsException(start+".."+end);
|
||||
}
|
||||
/*non-public*/
|
||||
static int rangeCheck1(int index, int size) {
|
||||
if (0 > index || index >= size)
|
||||
throw new IndexOutOfBoundsException(index);
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue