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 kr...@apache.org on 2011/09/02 09:28:23 UTC

svn commit: r1164379 - in /db/derby/code/branches/10.7: ./ java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java

Author: kristwaa
Date: Fri Sep  2 07:28:22 2011
New Revision: 1164379

URL: http://svn.apache.org/viewvc?rev=1164379&view=rev
Log:
DERBY-5393: Remove old in-memory database purge mechanism

Merged fix from trunk (revision 1164370).

Modified:
    db/derby/code/branches/10.7/   (props changed)
    db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java

Propchange: db/derby/code/branches/10.7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 07:28:22 2011
@@ -1 +1 @@
-/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480,1062096,1063809,1065061,1066290,1067250,1067357,1069661,1071463,1071886,1076335,1076387,1078461,1078608,1078693,1081072,1081455,1081568,1085078,1091000,1097247,1103681,1103718,1128243,1129136,1130632,1130895,1131272,1132664,1136363,1138341,1138444,1139449,1141924
+/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480,1062096,1063809,1065061,1066290,1067250,1067357,1069661,1071463,1071886,1076335,1076387,1078461,1078608,1078693,1081072,1081455,1081568,1085078,1091000,1097247,1103681,1103718,1128243,1129136,1130632,1130895,1131272,1132664,1136363,1138341,1138444,1139449,1141924,1164370

Modified: db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java?rev=1164379&r1=1164378&r2=1164379&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java (original)
+++ db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java Fri Sep  2 07:28:22 2011
@@ -63,26 +63,6 @@ public class VFMemoryStorageFactory
      */
     private static final DataStore DUMMY_STORE = new DataStore("::DUMMY::");
 
-    /**
-     * TODO: Remove this method once the new mechanism has been added.
-     * Deletes the database if it exists.
-     *
-     * @param dbName the database name
-     * @return {@code true} if the database was deleted, {@code false} otherwise
-     */
-    public static boolean purgeDatabase(final String dbName) {
-        // TODO: Should we check if the database is booted / active?
-        synchronized (DATABASES) {
-            DataStore store = (DataStore)DATABASES.remove(dbName);
-            if (store != null) {
-                // Delete everything.
-                store.purge();
-                return true;
-            }
-            return false;
-        }
-    }
-
     /** The canonical (unique) name of the database (absolute path). */
     private String canonicalName;
     /** The data directory of the database. */
@@ -329,7 +309,6 @@ public class VFMemoryStorageFactory
      */
     public void sync(OutputStream stream, boolean metaData) {
         // Does nothing, data is stored only in memory.
-        // TODO: Are there any streams that needs to be flushed?
     }
 
     public boolean supportsWriteSync() {
@@ -347,7 +326,7 @@ public class VFMemoryStorageFactory
      * @throws NullPointerException if {@code file} is {@code null}
      */
     private String normalizePath(String dir, String file) {
-        if (dir == null || dir.equals("")) {
+        if (dir == null || dir.length() == 0) {
             dir = dataDirectory.getPath();
         } else if (!new File(dir).isAbsolute()) {
             dir = new File(dataDirectory.getPath(), dir).getPath();
@@ -364,7 +343,7 @@ public class VFMemoryStorageFactory
      * @return A path.
      */
     private String normalizePath(String path) {
-        if (path == null || path.equals("")) {
+        if (path == null || path.length() == 0) {
             return dataDirectory.getPath();
         } else if (new File(path).isAbsolute()) {
             return path;