Author: imario
Date: Sun Nov  6 11:00:34 2005
New Revision: 331138

URL: http://svn.apache.org/viewcvs?rev=331138&view=rev
Log:
some additional changes

Modified:
    
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java

Modified: 
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java?rev=331138&r1=331137&r2=331138&view=diff
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java
 (original)
+++ 
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java
 Sun Nov  6 11:00:34 2005
@@ -188,6 +188,8 @@
        {
                Map files = getOrCreateFilesystemCache(filesystem);
 
+               boolean closeFilesystem;
+
                synchronized (files)
                {
                        Iterator iterKeys = refReverseMap.values().iterator();
@@ -201,9 +203,11 @@
                                        files.remove(key.getFileName());
                                }
                        }
+
+                       closeFilesystem = files.size() < 1;
                }
 
-               if (files.size() < 1)
+               if (closeFilesystem)
                {
                        filesystemClose(filesystem);
                }
@@ -231,17 +235,14 @@
        {
                super.close();
 
-               synchronized (this)
-               {
-                       endThread();
+               endThread();
 
-                       // files.clear();
-                       synchronized (filesystemCache)
-                       {
-                               filesystemCache.clear();
-                       }
-                       refReverseMap.clear();
+               // files.clear();
+               synchronized (filesystemCache)
+               {
+                       filesystemCache.clear();
                }
+               refReverseMap.clear();
        }
 
        public void removeFile(FileSystem filesystem, FileName name)



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to