Better test assert message. Javadoc fix.
Follow links when disabling readonly flag for a delete path call.
MODIFY
src/main/java/org/apache/commons/io/FileUtils.java
src/main/java/org/apache/commons/io/FileUtils.java
@@ -1408,7 +1408,7 @@ private static void doCopyFile(final File srcFile, final File destFile, final bo
}
/**
- * Sets the given {@code destFile}'s last modified date to the value from {@code srcFile}.
+ * Sets the given {@code targetFile}'s last modified date to the value from {@code sourceFile}.
*
* @param sourceFile The source file to query.
* @param targetFile The target file to set.

MODIFY
src/main/java/org/apache/commons/io/file/PathUtils.java
src/main/java/org/apache/commons/io/file/PathUtils.java
@@ -360,7 +360,7 @@ public static PathCounters deleteFile(final Path file, final DeleteOption... opt
final boolean exists = Files.exists(file, LinkOption.NOFOLLOW_LINKS);
final long size = exists ? Files.size(file) : 0;
if (overrideReadOnly(options) && exists) {
- setReadOnly(file, false, LinkOption.NOFOLLOW_LINKS);
+ setReadOnly(file, false/*, LinkOption.NOFOLLOW_LINKS*/);
}
if (Files.deleteIfExists(file)) {
pathCounts.getFileCounter().increment();

MODIFY
src/test/java/org/apache/commons/io/FileUtilsTestCase.java
src/test/java/org/apache/commons/io/FileUtilsTestCase.java
@@ -1238,9 +1238,9 @@ public void testCopyFile2WithoutFileDatePreservation() throws Exception {
final long destLastMod = getLastModifiedMillis(destFile);
final long unexpected = getLastModifiedMillis(testFile1);
if (!SystemUtils.IS_OS_WINDOWS) {
- assertNotEquals(unexpected, destLastMod,
- "Check last modified date not same as input, delta " + (destLastMod - unexpected));
- assertTrue(destLastMod > now, destLastMod + " > " + now);
+ final long delta = destLastMod - unexpected;
+ assertNotEquals(unexpected, destLastMod, "Check last modified date not same as input, delta " + delta);
+ assertTrue(destLastMod > now, destLastMod + " > " + now + " (delta " + delta + ")");
}
}

Better test assert message. Javadoc fix.
Follow links when disabling readonly flag for a delete path call.