[jira] [Created] (VFS-745) GetOrCreateFilesystemCaches might return unused Map

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (VFS-745) GetOrCreateFilesystemCaches might return unused Map

Bruno P. Kinoshita (Jira)
Bernd Eckenfels created VFS-745:
-----------------------------------

             Summary: GetOrCreateFilesystemCaches might return unused Map
                 Key: VFS-745
                 URL: https://issues.apache.org/jira/browse/VFS-745
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 2.4.1
            Reporter: Bernd Eckenfels


The LRauFilesCache implementations contains a `getOrCreateFilesystemCache` which uses putIfAbsent, however the returned cache might not be the one (not) put into the filesystemCaches map.

https://github.com/apache/commons-vfs/blob/b6fb9a392d9510ce039e55a26a47ed85750a4386/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java#L192

Also this should be probably inside the write lock, and the getFile should have the optimization not to create a filesystem entry like DefaultFilesCache does.







--
This message was sent by Atlassian Jira
(v8.3.4#803005)