harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r773958 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
Date Tue, 12 May 2009 16:15:26 GMT
Author: odeakin
Date: Tue May 12 16:15:25 2009
New Revision: 773958

URL: http://svn.apache.org/viewvc?rev=773958&view=rev
Log:
Minor change - ensure files is not null before we use it.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java?rev=773958&r1=773957&r2=773958&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
Tue May 12 16:15:25 2009
@@ -60,12 +60,14 @@
         // Delete all old temporary files
         File tempDir = new File(System.getProperty("java.io.tmpdir"));
         File[] files = tempDir.listFiles();
-        for (File file : files) {
-            if (file.getName().startsWith("harmony-test")) {
-                if (file.isDirectory()) {
-                    deleteTempFolder(file);
+        if (files != null) {
+            for (File file : files) {
+                if (file.getName().startsWith("harmony-test")) {
+                    if (file.isDirectory()) {
+                        deleteTempFolder(file);
+                    }
+                    file.delete();
                 }
-                file.delete();
             }
         }
     }



Mime
View raw message