harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r938029 - /harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/RandomAccessFile.java
Date Mon, 26 Apr 2010 13:08:12 GMT
Author: hindessm
Date: Mon Apr 26 13:08:12 2010
New Revision: 938029

URL: http://svn.apache.org/viewvc?rev=938029&view=rev
Log:
Changing this instance of the three seek pattern to use one JNI call
to fstat.  That this seems to behave correctly but that the RI does
three seeks for this case.  I can't understand why it makes sense to
use three seeks for this and fstat for FileChannel.

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

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/RandomAccessFile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/RandomAccessFile.java?rev=938029&r1=938028&r2=938029&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/RandomAccessFile.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/java/io/RandomAccessFile.java
Mon Apr 26 13:08:12 2010
@@ -263,13 +263,7 @@ public class RandomAccessFile implements
     public long length() throws IOException {
         openCheck();
         synchronized (repositionLock) {
-            long currentPosition = fileSystem.seek(fd.descriptor, 0L,
-                    IFileSystem.SEEK_CUR);
-            long endOfFilePosition = fileSystem.seek(fd.descriptor, 0L,
-                    IFileSystem.SEEK_END);
-            fileSystem.seek(fd.descriptor, currentPosition,
-                    IFileSystem.SEEK_SET);
-            return endOfFilePosition;
+            return fileSystem.size(fd.descriptor);
         }
     }
 



Mime
View raw message