From f6fe5efa54e6c48973eaf526cd93e2a7b508697e Mon Sep 17 00:00:00 2001 From: sherman Date: Thu, 15 Aug 2013 10:41:59 -0700 Subject: [PATCH] 7154662: {CRC32, Adler32}.update(byte[] b, int off, int len): undocumented ArrayIndexOutOfBoundsException Summary: to add the throws clause Reviewed-by: alanb, chegar --- src/share/classes/java/util/zip/Adler32.java | 5 +++++ src/share/classes/java/util/zip/CRC32.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/share/classes/java/util/zip/Adler32.java b/src/share/classes/java/util/zip/Adler32.java index 23475c263..bffc3af1c 100644 --- a/src/share/classes/java/util/zip/Adler32.java +++ b/src/share/classes/java/util/zip/Adler32.java @@ -62,6 +62,11 @@ class Adler32 implements Checksum { /** * Updates the checksum with the specified array of bytes. + * + * @throws ArrayIndexOutOfBoundsException + * if {@code off} is negative, or {@code len} is negative, + * or {@code off+len} is greater than the length of the + * array {@code b} */ public void update(byte[] b, int off, int len) { if (b == null) { diff --git a/src/share/classes/java/util/zip/CRC32.java b/src/share/classes/java/util/zip/CRC32.java index b5cccb0cc..187346fe5 100644 --- a/src/share/classes/java/util/zip/CRC32.java +++ b/src/share/classes/java/util/zip/CRC32.java @@ -60,6 +60,11 @@ class CRC32 implements Checksum { /** * Updates the CRC-32 checksum with the specified array of bytes. + * + * @throws ArrayIndexOutOfBoundsException + * if {@code off} is negative, or {@code len} is negative, + * or {@code off+len} is greater than the length of the + * array {@code b} */ public void update(byte[] b, int off, int len) { if (b == null) { -- GitLab