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 251da73b38f8c023869785735ea5fd4635a80e0e Author: Gary Gregory <[email protected]> AuthorDate: Fri Jan 31 11:38:41 2025 -0500 Javadoc - Reduce whitespace --- .../org/apache/commons/vfs2/provider/AbstractFileProvider.java | 2 -- .../commons/vfs2/provider/AbstractOriginatingFileProvider.java | 8 +++----- .../org/apache/commons/vfs2/provider/AbstractVfsContainer.java | 4 +--- 3 files changed, 4 insertions(+), 10 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 c70ee45a2..f105709be 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 @@ -65,10 +65,8 @@ public abstract class AbstractFileProvider extends AbstractVfsContainer implemen protected void addFileSystem(final Comparable<?> key, final FileSystem fs) throws FileSystemException { // Add to the container and initialize addComponent(fs); - final FileSystemKey treeKey = new FileSystemKey(key, fs.getFileSystemOptions()); ((AbstractFileSystem) fs).setCacheKey(treeKey); - synchronized (fileSystemMap) { fileSystemMap.put(treeKey, fs); } diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractOriginatingFileProvider.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractOriginatingFileProvider.java index c1148cbf7..eca8762f3 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractOriginatingFileProvider.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractOriginatingFileProvider.java @@ -49,7 +49,7 @@ public abstract class AbstractOriginatingFileProvider extends AbstractFileProvid * * @param fileName The file name. * @param fileSystemOptions FileSystem options. - * @return A FileObject associated with the file. + * @return A FileObject associated with the file, never null. * @throws FileSystemException if an error occurs. */ protected FileObject findFile(final FileName fileName, final FileSystemOptions fileSystemOptions) @@ -57,8 +57,7 @@ public abstract class AbstractOriginatingFileProvider extends AbstractFileProvid // Check in the cache for the file system final FileName rootName = getContext().getFileSystemManager().resolveName(fileName, FileName.ROOT_PATH); // Locate the file - final FileSystem fs = getFileSystem(rootName, fileSystemOptions); - return fs.resolveFile(fileName); + return getFileSystem(rootName, fileSystemOptions).resolveFile(fileName); } /** @@ -80,7 +79,6 @@ public abstract class AbstractOriginatingFileProvider extends AbstractFileProvid } catch (final FileSystemException exc) { throw new FileSystemException("vfs.provider/invalid-absolute-uri.error", uri, exc); } - // Locate the file return findFile(name, fileSystemOptions); } @@ -90,7 +88,7 @@ public abstract class AbstractOriginatingFileProvider extends AbstractFileProvid * * @param rootFileName The root path. * @param fileSystemOptions The FileSystem options. - * @return The FileSystem. + * @return The FileSystem, never null. * @throws FileSystemException if an error occurs. * @since 2.0 */ diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractVfsContainer.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractVfsContainer.java index cf38d03ef..8839c3af2 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractVfsContainer.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractVfsContainer.java @@ -58,11 +58,10 @@ public abstract class AbstractVfsContainer extends AbstractVfsComponent { vfsComponent.setContext(getContext()); vfsComponent.init(); } - // Keep track of component, to close it later components.add(component); } - } // synchronized + } } /** @@ -75,7 +74,6 @@ public abstract class AbstractVfsContainer extends AbstractVfsComponent { toclose = components.toArray(); components.clear(); } - // Close all components Stream.of(toclose).filter(VfsComponent.class::isInstance) .forEach(component -> ((VfsComponent) component).close());
