You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/09/16 02:23:59 UTC

[commons-vfs] 02/02: Allocate inside sync block.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git

commit bbd2151fe83ad9a5f335165c15b15aa5a4f7281e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Sep 15 22:23:48 2020 -0400

    Allocate inside sync block.
---
 .../java/org/apache/commons/vfs2/provider/AbstractFileProvider.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileProvider.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileProvider.java
index 6fabea9..8782419 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileProvider.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileProvider.java
@@ -109,14 +109,12 @@ public abstract class AbstractFileProvider extends AbstractVfsContainer implemen
      * Locates a cached file system.
      *
      * @param key The root file of the file system, part of the cache key.
-     * @param fileSystemOptions file system options the file system instance must have.
+     * @param fileSystemOptions file system options the file system instance must have, may be null.
      * @return The file system instance, or null if it is not cached.
      */
     protected FileSystem findFileSystem(final Comparable<?> key, final FileSystemOptions fileSystemOptions) {
-        final FileSystemKey treeKey = new FileSystemKey(key, fileSystemOptions);
-
         synchronized (fileSystems) {
-            return fileSystems.get(treeKey);
+            return fileSystems.get(new FileSystemKey(key, fileSystemOptions));
         }
     }