Use Java 8 API. Remove unused import.
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java
index 83d0ad3..4e2da10 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java
@@ -28,7 +28,6 @@
import org.apache.commons.vfs2.FileName;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystem;
-import org.apache.commons.vfs2.util.Messages;
/**
* This implementation caches every file as long as it is strongly reachable by the java vm. As soon as the vm needs
@@ -238,12 +237,6 @@
startThread();
}
- Map<FileName, Reference<FileObject>> files = fileSystemCache.get(fileSystem);
- if (files == null) {
- files = new HashMap<>();
- fileSystemCache.put(fileSystem, files);
- }
-
- return files;
+ return fileSystemCache.computeIfAbsent(fileSystem, k -> new HashMap<>());
}
}