You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/08/15 02:42:42 UTC
[commons-io] branch master updated: Better test assert message.
Javadoc fix. Follow links when disabling readonly flag for a delete path
call.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push:
new 2c92782 Better test assert message. Javadoc fix. Follow links when disabling readonly flag for a delete path call.
2c92782 is described below
commit 2c927824c43479b8577e9f15b9ab7642854be113
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Aug 14 22:42:34 2020 -0400
Better test assert message. Javadoc fix.
Follow links when disabling readonly flag for a delete path call.
---
src/main/java/org/apache/commons/io/FileUtils.java | 2 +-
src/main/java/org/apache/commons/io/file/PathUtils.java | 2 +-
src/test/java/org/apache/commons/io/FileUtilsTestCase.java | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java b/src/main/java/org/apache/commons/io/FileUtils.java
index 8cf6607..1a2eea7 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -1408,7 +1408,7 @@ public class FileUtils {
}
/**
- * 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.
diff --git a/src/main/java/org/apache/commons/io/file/PathUtils.java b/src/main/java/org/apache/commons/io/file/PathUtils.java
index d370ef0..fa82a11 100644
--- a/src/main/java/org/apache/commons/io/file/PathUtils.java
+++ b/src/main/java/org/apache/commons/io/file/PathUtils.java
@@ -360,7 +360,7 @@ public final class PathUtils {
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();
diff --git a/src/test/java/org/apache/commons/io/FileUtilsTestCase.java b/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
index c33d1fc..8778b67 100644
--- a/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
@@ -1238,9 +1238,9 @@ public class FileUtilsTestCase {
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 + ")");
}
}