summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-02-27 12:38:46 +0000
committerNarayan Kamath <narayan@google.com>2015-02-27 12:43:55 +0000
commita50a2ffbd82c953aa3a1d832e311ed8c869f454e (patch)
tree35cb3dc4ea409f5176899d027a459f33d6de897f /luni
parent26ef26ec963acca178c7d3d9781d84b38036469e (diff)
downloadlibcore-a50a2ffbd82c953aa3a1d832e311ed8c869f454e.zip
libcore-a50a2ffbd82c953aa3a1d832e311ed8c869f454e.tar.gz
libcore-a50a2ffbd82c953aa3a1d832e311ed8c869f454e.tar.bz2
Remove size check that was accidentally removed.
We can now accept sizes larger than 4GB, but negative sizes should still be rejected. Fixes harmony test ZipEntryTest#test_setSizeJ. Change-Id: Ie226daecb378ae5627b404dba926d53143ec7774
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/java/util/zip/ZipEntry.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/luni/src/main/java/java/util/zip/ZipEntry.java b/luni/src/main/java/java/util/zip/ZipEntry.java
index d6781b8..26f6863 100644
--- a/luni/src/main/java/java/util/zip/ZipEntry.java
+++ b/luni/src/main/java/java/util/zip/ZipEntry.java
@@ -269,8 +269,13 @@ public class ZipEntry implements ZipConstants, Cloneable {
* Sets the uncompressed size of this {@code ZipEntry}.
*
* @param value the uncompressed size for this entry.
+ * @throws IllegalArgumentException if {@code value < 0}.
*/
public void setSize(long value) {
+ if (value < 0) {
+ throw new IllegalArgumentException("Bad size: " + value);
+ }
+
size = value;
}