You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by im...@apache.org on 2005/11/06 20:00:39 UTC

svn commit: r331138 - /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java

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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org