You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/01/07 13:36:51 UTC

[GitHub] [commons-vfs] MaxKellermann commented on a change in pull request #154: Rework SoftRefFilesCache locking

MaxKellermann commented on a change in pull request #154:
URL: https://github.com/apache/commons-vfs/pull/154#discussion_r553330445



##########
File path: commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java
##########
@@ -43,85 +38,55 @@
  */
 public class SoftRefFilesCache extends AbstractFilesCache {
 
-    private static final int TIMEOUT = 1000;
-
     private static final Log log = LogFactory.getLog(SoftRefFilesCache.class);
 
-    private final ConcurrentMap<FileSystem, Map<FileName, Reference<FileObject>>> fileSystemCache = new ConcurrentHashMap<>();
+    private final Map<FileSystem, Map<FileName, Reference<FileObject>>> fileSystemCache = new HashMap<>();
     private final Map<Reference<FileObject>, FileSystemAndNameKey> refReverseMap = new HashMap<>(100);
     private final ReferenceQueue<FileObject> refQueue = new ReferenceQueue<>();
 
-    private volatile SoftRefReleaseThread softRefReleaseThread = null; // @GuardedBy("lock")
-
-    private final Lock lock = new ReentrantLock();
+    private SoftRefReleaseThread softRefReleaseThread = null;

Review comment:
       Agree, but not my code / choice. I only removed the `volatile` and the obsolete code comment. I preserved the old code as-is, and I think refactoring to remove unnecessary default values should not be mixed in this commit.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org