mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +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
|
@ -32,7 +32,7 @@ import java.io.OutputStream;
|
|||
import java.nio.ByteBuffer;
|
||||
|
||||
import sun.nio.cs.ISO_8859_1;
|
||||
|
||||
import jdk.internal.util.Preconditions;
|
||||
import jdk.internal.vm.annotation.IntrinsicCandidate;
|
||||
|
||||
/**
|
||||
|
@ -932,8 +932,7 @@ public class Base64 {
|
|||
public void write(byte[] b, int off, int len) throws IOException {
|
||||
if (closed)
|
||||
throw new IOException("Stream is closed");
|
||||
if (off < 0 || len < 0 || len > b.length - off)
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
Preconditions.checkFromIndexSize(len, off, b.length, Preconditions.AIOOBE_FORMATTER);
|
||||
if (len == 0)
|
||||
return;
|
||||
if (leftover != 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue