Browse Source

explicitly set milliseconds to 0 when parsing ZipEntry's time field, it has two second granularity anyway

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1536171 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 11 years ago
parent
commit
803f9c877e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/main/org/apache/tools/zip/ZipUtil.java

+ 2
- 1
src/main/org/apache/tools/zip/ZipUtil.java View File

@@ -107,6 +107,7 @@ public abstract class ZipUtil {
cal.set(Calendar.HOUR_OF_DAY, (int) (dosTime >> 11) & 0x1f); cal.set(Calendar.HOUR_OF_DAY, (int) (dosTime >> 11) & 0x1f);
cal.set(Calendar.MINUTE, (int) (dosTime >> 5) & 0x3f); cal.set(Calendar.MINUTE, (int) (dosTime >> 5) & 0x3f);
cal.set(Calendar.SECOND, (int) (dosTime << 1) & 0x3e); cal.set(Calendar.SECOND, (int) (dosTime << 1) & 0x3e);
cal.set(Calendar.MILLISECOND, 0);
// CheckStyle:MagicNumberCheck ON // CheckStyle:MagicNumberCheck ON
return cal.getTime().getTime(); return cal.getTime().getTime();
} }
@@ -228,4 +229,4 @@ public abstract class ZipUtil {
.Feature.METHOD, ze); .Feature.METHOD, ze);
} }
} }
}
}

Loading…
Cancel
Save