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 d28e5d5  [IO-748] FileUtils.moveToDirectory() exception documentation 
and exception message error.
d28e5d5 is described below

commit d28e5d59c0366ddfbbdd05d6d30f39f1df99e300
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Sep 6 10:16:57 2021 -0400

    [IO-748] FileUtils.moveToDirectory() exception documentation and
    exception message error.
---
 src/changes/changes.xml                            | 3 +++
 src/main/java/org/apache/commons/io/FileUtils.java | 5 ++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 8440b3c..ebf10a1 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -65,6 +65,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action issue="IO-746" dev="ggregory" type="add" due-to="Davide 
Angelocola">
         Drop unnecessary casts and conversions #267.
       </action>
+      <action issue="IO-748" dev="ggregory" type="fix" due-to="Dirk Heinrichs, 
Gary Gregory">
+        FileUtils.moveToDirectory() exception documentation and exception 
message error.
+      </action>
       <!-- ADD -->
       <action dev="ggregory" type="add" due-to="Gary Gregory">
         Add BrokenReader.INSTANCE.
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java 
b/src/main/java/org/apache/commons/io/FileUtils.java
index de35e63..ae132fc 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -2302,7 +2302,7 @@ public class FileUtils {
             throws IOException {
         validateMoveParameters(srcFile, destFile);
         requireFile(srcFile, "srcFile");
-        requireAbsent(destFile, null);
+        requireAbsent(destFile, "destFile");
         final boolean rename = srcFile.renameTo(destFile);
         if (!rename) {
             copyFile(srcFile, destFile, copyOptions);
@@ -2599,8 +2599,7 @@ public class FileUtils {
 
     private static void requireAbsent(final File file, final String name) 
throws FileExistsException {
         if (file.exists()) {
-            throw new FileExistsException(
-                String.format("File element in parameter '%s' already exists: 
'%s'", name, file));
+            throw new FileExistsException(String.format("File element in 
parameter '%s' already exists: '%s'", name, file));
         }
     }
 

Reply via email to