db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1220670 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/io: DirFile4.java DirStorageFactory4.java
Date Mon, 19 Dec 2011 09:32:26 GMT
Author: kahatlen
Date: Mon Dec 19 09:32:26 2011
New Revision: 1220670

URL: http://svn.apache.org/viewvc?rev=1220670&view=rev
Log:
DERBY-5541: Remove unnecessary field rwsOK in DirStorageFactory4

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirFile4.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.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=1220670&r1=1220669&r2=1220670&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 Mon Dec 19 09:32:26
2011
@@ -50,17 +50,14 @@ class DirFile4 extends DirFile
     private FileChannel lockFileChannel;
     private FileLock dbLock;
 
-	private final boolean rwsOK;
-
     /**
      * Construct a DirFile from a path name.
      *
      * @param path The path name.
      */
-    DirFile4( String path, boolean rwsOK)
+    DirFile4(String path)
     {
         super( path);
-		this.rwsOK = rwsOK;
     }
 
     /**
@@ -69,10 +66,9 @@ class DirFile4 extends DirFile
      * @param directoryName The directory part of the path name.
      * @param fileName The name of the file within the directory.
      */
-    DirFile4( String directoryName, String fileName, boolean rwsOK)
+    DirFile4(String directoryName, String fileName)
     {
         super( directoryName, fileName);
-		this.rwsOK = rwsOK;
     }
 
     /**
@@ -81,10 +77,9 @@ class DirFile4 extends DirFile
      * @param directoryName The directory part of the path name.
      * @param fileName The name of the file within the directory.
      */
-    DirFile4( DirFile directoryName, String fileName, boolean rwsOK)
+    DirFile4( DirFile directoryName, String fileName)
     {
         super( directoryName, fileName);
-		this.rwsOK = rwsOK;
     }
 
     /**
@@ -98,7 +93,7 @@ class DirFile4 extends DirFile
         String parent = getParent();
         if( parent == null)
             return null;
-        return new DirFile4( parent, rwsOK);
+        return new DirFile4(parent);
     }
     
     /**
@@ -292,9 +287,6 @@ class DirFile4 extends DirFile
      */
     public StorageRandomAccessFile getRandomAccessFile( String mode) throws FileNotFoundException
     {
-        // Assume that modes "rws" and "rwd" are not supported.
-        if(!rwsOK && ("rws".equals( mode) || "rwd".equals( mode)))
-            mode = "rw";
         return new DirRandomAccessFile( (File) this, mode);
     } // end of getRandomAccessFile
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.java?rev=1220670&r1=1220669&r2=1220670&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/DirStorageFactory4.java Mon Dec
19 09:32:26 2011
@@ -22,9 +22,6 @@
 package org.apache.derby.impl.io;
 
 import org.apache.derby.io.StorageFile;
-import org.apache.derby.iapi.services.info.JVMInfo;
-
-import java.io.IOException;
 
 /**
  * This class implements the WritableStorageFactory interface using features found in Java
1.4 but
@@ -33,8 +30,6 @@ import java.io.IOException;
 public class DirStorageFactory4 extends DirStorageFactory
 {
 
-	private static final boolean	rwsOK = JVMInfo.JDK_ID >= JVMInfo.J2SE_142;
-    
     /**
      * Most of the initialization is done in the init method.
      */
@@ -54,8 +49,8 @@ public class DirStorageFactory4 extends 
     StorageFile newPersistentFile( String path)
     {
         if( path == null)
-            return new DirFile4(dataDirectory, rwsOK);
-        return new DirFile4(dataDirectory, path, rwsOK);
+            return new DirFile4(dataDirectory);
+        return new DirFile4(dataDirectory, path);
     }
 
     /**
@@ -69,7 +64,7 @@ public class DirStorageFactory4 extends 
      */
     StorageFile newPersistentFile( String directoryName, String fileName)
     {
-        return new DirFile4( separatedDataDirectory + directoryName, fileName, rwsOK);
+        return new DirFile4( separatedDataDirectory + directoryName, fileName);
     }
 
     /**
@@ -83,7 +78,7 @@ public class DirStorageFactory4 extends 
      */
     StorageFile newPersistentFile( StorageFile directoryName, String fileName)
     {
-        return new DirFile4( (DirFile) directoryName, fileName, rwsOK);
+        return new DirFile4((DirFile) directoryName, fileName);
     }
 
 	
@@ -99,7 +94,7 @@ public class DirStorageFactory4 extends 
      */
     public boolean supportsWriteSync()
     {
-        return rwsOK;
+        return true;
     }
 	
 



Mime
View raw message