bodewig 2005/02/18 05:16:48
Modified: . Tag: ANT_16_BRANCH WHATSNEW
src/main/org/apache/tools/zip Tag: ANT_16_BRANCH
ZipOutputStream.java
Log:
merge
Revision Changes Path
No revision
No revision
1.503.2.179 +3 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.503.2.178
retrieving revision 1.503.2.179
diff -u -r1.503.2.178 -r1.503.2.179
--- WHATSNEW 18 Feb 2005 12:29:50 -0000 1.503.2.178
+++ WHATSNEW 18 Feb 2005 13:16:47 -0000 1.503.2.179
@@ -207,6 +207,9 @@
* <zip>'s defaultexcludes attribute was ignored when an archive was
updated. Bugzilla Report 33412.
+* <zip> couldn't store files with size between 2GB and 4GB (the
+ upper limit set by the ZIP format itself). Bugzilla Report 33310.
+
Changes from Ant 1.6.1 to Ant 1.6.2
===================================
No revision
No revision
1.17.2.8 +19 -4 ant/src/main/org/apache/tools/zip/ZipOutputStream.java
Index: ZipOutputStream.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/zip/ZipOutputStream.java,v
retrieving revision 1.17.2.7
retrieving revision 1.17.2.8
diff -u -r1.17.2.7 -r1.17.2.8
--- ZipOutputStream.java 18 May 2004 08:15:08 -0000 1.17.2.7
+++ ZipOutputStream.java 18 Feb 2005 13:16:48 -0000 1.17.2.8
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation
+ * Copyright 2001-2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -326,8 +326,8 @@
deflate();
}
- entry.setSize(def.getTotalIn());
- entry.setComprSize(def.getTotalOut());
+ entry.setSize(adjustToLong(def.getTotalIn()));
+ entry.setComprSize(adjustToLong(def.getTotalOut()));
entry.setCrc(realCrc);
def.reset();
@@ -829,4 +829,19 @@
out.write(data, offset, length);
}
}
+
+ /**
+ * Assumes a negative integer really is a positive integer that
+ * has wrapped around and re-creates the original value.
+ *
+ * @since 1.17.2.8
+ */
+ protected static long adjustToLong(int i) {
+ if (i < 0) {
+ return 2 * ((long) Integer.MAX_VALUE) + 2 + i;
+ } else {
+ return i;
+ }
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]