harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r360076 - /incubator/harmony/enhanced/classlib/trunk/java-src/luni/src/main/java/java/io/File.java
Date Fri, 30 Dec 2005 12:37:24 GMT
Author: tellison
Date: Fri Dec 30 04:37:20 2005
New Revision: 360076

URL: http://svn.apache.org/viewcvs?rev=360076&view=rev
Log:
Checking that a file can be written should not imply it can be read.

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

Modified: incubator/harmony/enhanced/classlib/trunk/java-src/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/java-src/luni/src/main/java/java/io/File.java?rev=360076&r1=360075&r2=360076&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/java-src/luni/src/main/java/java/io/File.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/java-src/luni/src/main/java/java/io/File.java
Fri Dec 30 04:37:20 2005
@@ -306,7 +306,13 @@
 		SecurityManager security = System.getSecurityManager();
 		if (security != null)
 			security.checkWrite(path);
-		return exists() && !isReadOnlyImpl(properPath(true));
+		
+		// Cannot use exists() since that does an unwanted read-check.
+		boolean exists = false;
+		if (path.length() > 0) {
+			exists = existsImpl(properPath(true));
+		}
+		return exists && !isReadOnlyImpl(properPath(true));
 	}
 
 	/**



Mime
View raw message