harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r696202 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
Date Wed, 17 Sep 2008 08:53:38 GMT
Author: tellison
Date: Wed Sep 17 01:53:36 2008
New Revision: 696202

URL: http://svn.apache.org/viewvc?rev=696202&view=rev
Log:
Apply patch for HARMONY-5979 ([classlib][luni] - File.deleteOnExit has different behaviours
with RI)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java?rev=696202&r1=696201&r2=696202&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
Wed Sep 17 01:53:36 2008
@@ -35,15 +35,9 @@
 	}
 
 	public static void deleteOnExit() {
-        java.util.Collections.sort(deleteList,
-                new java.util.Comparator<String>() {
-                    public int compare(String s1, String s2) {
-                        return s2.length() - s1.length();
-                    }
-                });
-		for (int i = 0; i < deleteList.size(); i++) {
-			String name = deleteList.elementAt(i);
-			new File(name).delete();
-		}
+        for (int i = deleteList.size() - 1; i >= 0; i--) {
+            String name = deleteList.elementAt(i);
+            new File(name).delete();
+        }
 	}
 }



Mime
View raw message