This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[patch] Fix java.util.zip.ZipEntry.setTime
- From: Jerry Quinn <jlquinn at optonline dot net>
- To: java-patches at gcc dot gnu dot org
- Date: Sat, 05 Jun 2004 17:36:27 -0400
- Subject: [patch] Fix java.util.zip.ZipEntry.setTime
Currently, setTime mangles the time by scaling, constructing dostime,
then unscaling dostime. The scaling is unnecessary. Testcase added
to mauve.
2004-06-05 Jerry Quinn <jlquinn@optonline.net>
* java/util/zip/ZipEntry.java (setTime): Remove scaling.
--- ZipEntry.java.~1.19.~ 2004-05-06 23:17:57.000000000 -0400
+++ ZipEntry.java 2004-06-05 16:06:06.000000000 -0400
@@ -168,7 +168,7 @@
Calendar cal = getCalendar();
synchronized (cal)
{
- cal.setTime(new Date(time*1000L));
+ cal.setTime(new Date(time));
dostime = (cal.get(Calendar.YEAR) - 1980 & 0x7f) << 25
| (cal.get(Calendar.MONTH) + 1) << 21
| (cal.get(Calendar.DAY_OF_MONTH)) << 16
@@ -176,7 +176,6 @@
| (cal.get(Calendar.MINUTE)) << 5
| (cal.get(Calendar.SECOND)) >> 1;
}
- dostime = (int) (dostime / 1000L);
this.known |= KNOWN_TIME;
}