Browse Source

looks as if bug 41948 was reappearing on Win7, needs further inverstigation - add some diagnostics

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@936720 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 15 years ago
parent
commit
38446ae431
2 changed files with 3 additions and 0 deletions
  1. +2
    -0
      src/main/org/apache/tools/ant/taskdefs/Move.java
  2. +1
    -0
      src/main/org/apache/tools/ant/util/FileUtils.java

+ 2
- 0
src/main/org/apache/tools/ant/taskdefs/Move.java View File

@@ -338,6 +338,8 @@ public class Move extends Copy {
destFile = getFileUtils().normalize(destFile.getAbsolutePath()); destFile = getFileUtils().normalize(destFile.getAbsolutePath());
if (destFile.equals(sourceFile)) { if (destFile.equals(sourceFile)) {
//no point in renaming a file to its own canonical version... //no point in renaming a file to its own canonical version...
log("Rename of " + sourceFile + " to " + destFile
+ " is a no-op.", Project.MSG_VERBOSE);
return true; return true;
} }
if (!(sourceFile.equals(destFile.getCanonicalFile()) || destFile.delete())) { if (!(sourceFile.equals(destFile.getCanonicalFile()) || destFile.delete())) {


+ 1
- 0
src/main/org/apache/tools/ant/util/FileUtils.java View File

@@ -1223,6 +1223,7 @@ public class FileUtils {
* @since Ant 1.6 * @since Ant 1.6
*/ */
public void rename(File from, File to) throws IOException { public void rename(File from, File to) throws IOException {
// identical logic lives in Move.renameFile():
from = normalize(from.getAbsolutePath()).getCanonicalFile(); from = normalize(from.getAbsolutePath()).getCanonicalFile();
to = normalize(to.getAbsolutePath()); to = normalize(to.getAbsolutePath());
if (!from.exists()) { if (!from.exists()) {


Loading…
Cancel
Save