Skip to content

Commit 7e2cda5

Browse files
committed
Improved the javadoc comment for the toLocalTimeZone() method.
1 parent d285476 commit 7e2cda5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/test/java/org/codehaus/plexus/archiver/zip/ZipArchiverTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,14 @@ public void testFixedEntryModificationTime()
913913
}
914914

915915
/**
916-
* Takes a timestamp located in GMT TZ and convert it to the default system TZ. This makes the test independent of
917-
* the current TZ.
916+
* Takes a timestamp, turns it into a textual representation based on GMT, then translated it into a timestamp in
917+
* local timezone. This makes the test independent of the current TimeZone. The reason this is necessary is:
918+
* <ul>
919+
* <li>ZIP file format does not take timezone into account.</li>
920+
* <li>In the process of converting the ZipEntry time from the DOS date format specified by the ZIP file format, the
921+
* timestamp is converted to a Java Date object, which DOES depends of the current system TimeZone, therefore
922+
* changing the value of the Date object representing that timestamp relative to the local TimeZone.</li>
923+
* </ul>
918924
*
919925
* @param timestamp the epoch time to convert.
920926
* @return the timestamp matching the same input date but in the local TZ.

0 commit comments

Comments
 (0)