mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +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
|
@ -5178,9 +5178,7 @@ public class Collections {
|
|||
}
|
||||
|
||||
public E get(int index) {
|
||||
if (index < 0 || index >= n)
|
||||
throw new IndexOutOfBoundsException("Index: "+index+
|
||||
", Size: "+n);
|
||||
Objects.checkIndex(index, n);
|
||||
return element;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue