From 991bb160b4565b60467fa4d2690c436cee8c1833 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Mon, 11 Apr 2011 18:30:09 +0200 Subject: [PATCH] cleanup old code --- .../vfs/newvfs/persistent/FSRecords.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java index c5d1f23e9728..49374531ff56 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java @@ -101,7 +101,7 @@ public class FSRecords implements Forceable { } private static class DbConnection { - private static int refCount = 0; + private static boolean ourInitialized; private static final TObjectIntHashMap myAttributeIds = new TObjectIntHashMap(); private static PersistentStringEnumerator myNames; @@ -114,17 +114,15 @@ public class FSRecords implements Forceable { private static ScheduledFuture myFlushingFuture; private static boolean myCorrupted = false; - public static DbConnection connect() { + public static void connect() { synchronized (lock) { - if (refCount == 0) { + if (!ourInitialized) { init(); scanFreeRecords(); setupFlushing(); + ourInitialized = true; } - refCount++; } - - return new DbConnection(); } private static void scanFreeRecords() { @@ -384,15 +382,6 @@ public class FSRecords implements Forceable { return myRecords; } - public static void dispose() throws IOException { - synchronized (lock) { - refCount--; - if (refCount == 0) { - closeFiles(); - } - } - } - private static void closeFiles() throws IOException { if (myFlushingFuture != null) { myFlushingFuture.cancel(false);