harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r765842 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
Date Fri, 17 Apr 2009 03:21:30 GMT
Author: regisxu
Date: Fri Apr 17 03:21:29 2009
New Revision: 765842

URL: http://svn.apache.org/viewvc?rev=765842&view=rev
Log:
Fix HARMONY-6093: [classlib][luni] Remove double security check in java.io.File

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java?rev=765842&r1=765841&r2=765842&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java Fri Apr 17
03:21:29 2009
@@ -311,11 +311,15 @@
      * @see java.lang.SecurityManager#checkRead(FileDescriptor)
      */
     public boolean canRead() {
+        if (path.length() == 0) {
+            return false;
+        }
         SecurityManager security = System.getSecurityManager();
         if (security != null) {
             security.checkRead(path);
         }
-        return exists() && !isWriteOnlyImpl(properPath(true));
+        byte[] pp = properPath(true);
+        return existsImpl(pp) && !isWriteOnlyImpl(pp);
     }
 
     /**



Mime
View raw message