harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r765253 - /harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
Date Wed, 15 Apr 2009 16:07:19 GMT
Author: odeakin
Date: Wed Apr 15 16:07:18 2009
New Revision: 765253

URL: http://svn.apache.org/viewvc?rev=765253&view=rev
Log:
Avoid a NullPointerException if file listing fails.

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

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java?rev=765253&r1=765252&r2=765253&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
Wed Apr 15 16:07:18 2009
@@ -58,15 +58,17 @@
         // Delete all old temporary files
         File tempDir = new File(System.getProperty("java.io.tmpdir"));
         String[] files = tempDir.list();
-        for (int i = 0; i < files.length; i++) {
-            File f = new File(tempDir, files[i]);
-            if (f.isDirectory()) {
-                if (files[i].startsWith("hyts_resources")) {
-                    deleteTempFolder(f);
+        if (files != null) {
+            for (int i = 0; i < files.length; i++) {
+                File f = new File(tempDir, files[i]);
+                if (f.isDirectory()) {
+                    if (files[i].startsWith("hyts_resources")) {
+                        deleteTempFolder(f);
+                    }
+                }
+                if (files[i].startsWith("hyts_") || files[i].startsWith("hyjar_")) {
+                    new File(tempDir, files[i]).delete();
                 }
-            }
-            if (files[i].startsWith("hyts_") || files[i].startsWith("hyjar_")) {
-                new File(tempDir, files[i]).delete();
             }
         }
     }



Mime
View raw message