You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by su...@apache.org on 2006/09/01 03:19:50 UTC

svn commit: r439128 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java

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