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

commit b8c11df6c016067c19211fdfba2a28d1cd599be7
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Fri Apr 28 16:47:39 2023 -0400

    Missing throw in org.apache.commons.io.FileUtils.copyFile(File, File,
    boolean, CopyOption...)
---
 src/main/java/org/apache/commons/io/FileUtils.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/FileUtils.java 
b/src/main/java/org/apache/commons/io/FileUtils.java
index 6c832768..b4bb92b2 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -813,10 +813,8 @@ public class FileUtils {
         Files.copy(srcFile.toPath(), destFile.toPath(), copyOptions);
 
         // On Windows, the last modified time is copied by default.
-        if (preserveFileDate) {
-            if (!setTimes(srcFile, destFile)) {
-                throw new IOException("Cannot set the file time.");
-            }
+        if (preserveFileDate && !setTimes(srcFile, destFile)) {
+            throw new IOException("Cannot set the file time.");
         }
     }
 

Reply via email to