FileUtils: Remove Instant->ZonedDateTime->Instant round-trip
This to/from round-trip conversion has no effect on the value of the
Instant.
MODIFY
src/changes/changes.xml
src/changes/changes.xml
@@ -59,6 +59,9 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="update" due-to="Gary Gregory">
Update commons.jacoco.version 0.8.5 to 0.8.6 (Fixes Java 15 builds).
</action>
+ <action issue="IO-689" dev="aherbert" type="fix" due-to="Uwe Schindler">
+ FileUtils: Remove Instant->ZonedDateTime->Instant round-trip.
+ </action>
</release>
<!-- The release date is the date RC is cut -->
<release version="2.8.0" date="2020-09-05" description="Java 8 required.">

MODIFY
src/main/java/org/apache/commons/io/FileUtils.java
src/main/java/org/apache/commons/io/FileUtils.java
@@ -1787,7 +1787,7 @@ public static boolean isFileNewer(final File file, final File reference) {
*/
public static boolean isFileNewer(final File file, final Instant instant) {
Objects.requireNonNull(instant, "instant");
- return isFileNewer(file, instant.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
+ return isFileNewer(file, instant.toEpochMilli());
}
/**
@@ -1955,7 +1955,7 @@ public static boolean isFileOlder(final File file, final File reference) {
*/
public static boolean isFileOlder(final File file, final Instant instant) {
Objects.requireNonNull(instant, "instant");
- return isFileOlder(file, instant.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
+ return isFileOlder(file, instant.toEpochMilli());
}
/**

IO-689: FileUtils: Remove Instant->ZonedDateTime->Instant round-trip

This to/from round-trip conversion has no effect on the value of the
Instant.