commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r331138 - /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/cache/SoftRefFilesCache.java
Date Sun, 06 Nov 2005 19:00:39 GMT
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


Mime
View raw message