You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oz...@apache.org on 2007/09/06 18:30:30 UTC

svn commit: r573317 - /commons/proper/transaction/branches/TRANSACTION_1_2_RELEASE_BRANCH/src/java/org/apache/commons/transaction/file/FileResourceManager.java

Author: ozeigermann
Date: Thu Sep  6 09:30:29 2007
New Revision: 573317

URL: http://svn.apache.org/viewvc?rev=573317&view=rev
Log:
Speed enhancement fix for deletes as described in https://issues.apache.org/jira/browse/TRANSACTION-26. 

Fix as described in https://issues.apache.org/jira/browse/TRANSACTION-18 and https://issues.apache.org/jira/browse/TRANSACTION-19.

Thanks to Bojan Vukojevic.

Modified:
    commons/proper/transaction/branches/TRANSACTION_1_2_RELEASE_BRANCH/src/java/org/apache/commons/transaction/file/FileResourceManager.java

Modified: commons/proper/transaction/branches/TRANSACTION_1_2_RELEASE_BRANCH/src/java/org/apache/commons/transaction/file/FileResourceManager.java
URL: http://svn.apache.org/viewvc/commons/proper/transaction/branches/TRANSACTION_1_2_RELEASE_BRANCH/src/java/org/apache/commons/transaction/file/FileResourceManager.java?rev=573317&r1=573316&r2=573317&view=diff
==============================================================================
--- commons/proper/transaction/branches/TRANSACTION_1_2_RELEASE_BRANCH/src/java/org/apache/commons/transaction/file/FileResourceManager.java (original)
+++ commons/proper/transaction/branches/TRANSACTION_1_2_RELEASE_BRANCH/src/java/org/apache/commons/transaction/file/FileResourceManager.java Thu Sep  6 09:30:29 2007
@@ -145,7 +145,8 @@
      *  
      */
 
-    protected static void applyDeletes(File removeDir, File targetDir, File rootDir) throws IOException {
+    protected static void applyDeletes(File removeDir, File targetDir, File rootDir)
+            throws IOException {
         if (removeDir.isDirectory() && targetDir.isDirectory()) {
             File[] files = removeDir.listFiles();
             for (int i = 0; i < files.length; i++) {
@@ -163,10 +164,10 @@
                 } else {
                     applyDeletes(removeFile, targetFile, rootDir);
                 }
-                // delete empty target directories, except root dir
-                if (!targetDir.equals(rootDir) && targetDir.list().length == 0) {
-                    targetDir.delete();
-                }
+            }
+            // delete empty target directories, except root dir
+            if (!targetDir.equals(rootDir) && targetDir.list().length == 0) {
+                targetDir.delete();
             }
         }
     }