db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sure...@apache.org
Subject svn commit: r439128 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java
Date Fri, 01 Sep 2006 01:19:50 GMT
Author: suresht
Date: Thu Aug 31 18:19:50 2006
New Revision: 439128

URL: http://svn.apache.org/viewvc?rev=439128&view=rev
Log:
DERBY-1783 (opening of file even on jvms with support for "rwd" mode incorrectly maps to "rw"
mode). 

Patch that fixes the logical code error by adding parentheses around the OR clause. In addition
one minor fix to the javadoc for the method is done.

Patch Contributed by Olav Sandstaa.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java?rev=439128&r1=439127&r2=439128&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java Thu Aug 31 18:19:50
2006
@@ -238,14 +238,14 @@
      *
      * @return an object that can be used for random access to the file.
      *
-     * @exception IllegalArgumentException if the mode argument is not equal to one of "r",
"rw".
+     * @exception IllegalArgumentException if the mode argument is not equal to one of "r",
"rw", "rws", or "rwd".
      * @exception FileNotFoundException if the file exists but is a directory rather than
a regular
      *              file, or cannot be opened or created for any other reason .
      */
     public StorageRandomAccessFile getRandomAccessFile( String mode) throws FileNotFoundException
     {
         // Assume that modes "rws" and "rwd" are not supported.
-        if(!rwsOK && "rws".equals( mode) || "rwd".equals( mode))
+        if(!rwsOK && ("rws".equals( mode) || "rwd".equals( mode)))
             mode = "rw";
         return new DirRandomAccessFile4( (File) this, mode);
     } // end of getRandomAccessFile



Mime
View raw message