Fix closing the files cache after warning that not all components have been closed (#165)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
index b47c256..75a28ae 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
@@ -555,6 +555,9 @@
// collections with add()
typeMap.clear();
+ // Close cache last.
+ closeComponent(filesCache);
+
// should not happen, but make debugging easier:
if (!components.isEmpty()) {
log.warn("DefaultFilesystemManager.close: not all components are closed: " + components.toString());
@@ -567,11 +570,6 @@
// virtual schemas
virtualFileSystemSchemes.clear();
- // Close cache last.
- if (filesCache != null) {
- filesCache.close();
- }
-
// setters and derived state
defaultProvider = null;
baseFile = null;