diff --git a/src/main/org/apache/tools/ant/taskdefs/Move.java b/src/main/org/apache/tools/ant/taskdefs/Move.java index a2680705d..358654fcc 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Move.java +++ b/src/main/org/apache/tools/ant/taskdefs/Move.java @@ -349,7 +349,7 @@ public class Move extends Copy { } else if (destFile.isFile()) { sourceFile = getFileUtils().normalize(sourceFile.getAbsolutePath()).getCanonicalFile(); destFile = getFileUtils().normalize(destFile.getAbsolutePath()); - if (destFile.equals(sourceFile)) { + if (destFile.getAbsolutePath().equals(sourceFile.getAbsolutePath())) { //no point in renaming a file to its own canonical version... log("Rename of " + sourceFile + " to " + destFile + " is a no-op.", Project.MSG_VERBOSE); diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java b/src/main/org/apache/tools/ant/util/FileUtils.java index b36f01f1a..fe1b6859a 100644 --- a/src/main/org/apache/tools/ant/util/FileUtils.java +++ b/src/main/org/apache/tools/ant/util/FileUtils.java @@ -1273,7 +1273,7 @@ public class FileUtils { System.err.println("Cannot rename nonexistent file " + from); return; } - if (from.equals(to)) { + if (from.getAbsolutePath().equals(to.getAbsolutePath())) { System.err.println("Rename of " + from + " to " + to + " is a no-op."); return; }