mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8276806: Use Objects.checkFromIndexSize where possible in java.base
Reviewed-by: rriggs, lancea
This commit is contained in:
parent
30087cc1b8
commit
73a9654c26
11 changed files with 40 additions and 43 deletions
|
@ -28,6 +28,7 @@ package java.util.zip;
|
|||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Objects;
|
||||
import java.util.Vector;
|
||||
import java.util.HashSet;
|
||||
import static java.util.zip.ZipConstants64.*;
|
||||
|
@ -333,9 +334,8 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant
|
|||
throws IOException
|
||||
{
|
||||
ensureOpen();
|
||||
if (off < 0 || len < 0 || off > b.length - len) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
} else if (len == 0) {
|
||||
Objects.checkFromIndexSize(off, len, b.length);
|
||||
if (len == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue