cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r569042 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/util/Util.java
Date Thu, 23 Aug 2007 15:29:06 GMT
Author: aadamchik
Date: Thu Aug 23 08:29:05 2007
New Revision: 569042

URL: http://svn.apache.org/viewvc?rev=569042&view=rev
Log:
CAY-852 NPE in Util.delete for read-protected directories

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/util/Util.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=569042&r1=569041&r2=569042&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Thu Aug 23 08:29:05 2007
@@ -36,6 +36,7 @@
 CAY-835 setting meaningful pk to zero turn on autogenerated keys
 CAY-845 DataContext.localObject() object update race condition
 CAY-847 Expression NULL handling
+CAY-852 NPE in Util.delete for read-protected directories
 
 
 ----------------------------------

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/util/Util.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/util/Util.java?rev=569042&r1=569041&r2=569042&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/util/Util.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/util/Util.java
Thu Aug 23 08:29:05 2007
@@ -201,9 +201,13 @@
             return file.delete();
 
         String[] list = file.list();
-        for (int i = 0; i < list.length; i++) {
-            if (!delete(filePath + File.separator + list[i], true))
-                return false;
+        
+        // list can be null if directory doesn't have an 'x' permission bit set for the user
+        if (list != null) {
+            for (int i = 0; i < list.length; i++) {
+                if (!delete(filePath + File.separator + list[i], true))
+                    return false;
+            }
         }
 
         return file.delete();



Mime
View raw message