ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r953257 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Date Thu, 10 Jun 2010 09:24:14 GMT
Author: bodewig
Date: Thu Jun 10 09:24:13 2010
New Revision: 953257

URL: http://svn.apache.org/viewvc?rev=953257&view=rev
Log:
try a little harder when deleting temporary files in <junit>

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java?rev=953257&r1=953256&r2=953257&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Thu
Jun 10 09:24:13 2010
@@ -881,7 +881,7 @@ public class JUnitTask extends Task {
             FILE_UTILS.close(writer);
 
             try {
-                casesFile.delete();
+                FILE_UTILS.tryHardToDelete(casesFile);
             } catch (Exception e) {
                 log(e.toString(), Project.MSG_ERR);
             }
@@ -979,7 +979,7 @@ public class JUnitTask extends Task {
             props.store(outstream, "Ant JUnitTask generated properties file");
             outstream.close();
         } catch (java.io.IOException e) {
-            propsFile.delete();
+            FILE_UTILS.tryHardToDelete(propsFile);
             throw new BuildException("Error creating temporary properties "
                                      + "file.", e, getLocation());
         }
@@ -1034,7 +1034,7 @@ public class JUnitTask extends Task {
             } finally {
                 FileUtils.close(br);
                 if (vmWatcher.exists()) {
-                    vmWatcher.delete();
+                    FILE_UTILS.tryHardToDelete(vmWatcher);
                 }
             }
 
@@ -1053,7 +1053,7 @@ public class JUnitTask extends Task {
                 logVmCrash(feArray, test, vmCrashString);
             }
 
-            if (!propsFile.delete()) {
+            if (!FILE_UTILS.tryHardToDelete(propsFile)) {
                 throw new BuildException("Could not delete temporary "
                                          + "properties file.");
             }



Mime
View raw message