From bb69156c80e732cb1c62b7fc0294797a34b139f7 Mon Sep 17 00:00:00 2001 From: Xueming Shen Date: Thu, 15 Aug 2013 10:41:59 -0700 Subject: [PATCH] 7154662: {CRC32, Adler32}.update(byte[] b, int off, int len): undocumented ArrayIndexOutOfBoundsException To add the throws clause Reviewed-by: alanb, chegar --- jdk/src/share/classes/java/util/zip/Adler32.java | 5 +++++ jdk/src/share/classes/java/util/zip/CRC32.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/jdk/src/share/classes/java/util/zip/Adler32.java b/jdk/src/share/classes/java/util/zip/Adler32.java index 23475c263dd..bffc3af1c03 100644 --- a/jdk/src/share/classes/java/util/zip/Adler32.java +++ b/jdk/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/jdk/src/share/classes/java/util/zip/CRC32.java b/jdk/src/share/classes/java/util/zip/CRC32.java index b5cccb0cc8e..187346fe55b 100644 --- a/jdk/src/share/classes/java/util/zip/CRC32.java +++ b/jdk/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) {