garydgregory commented on a change in pull request #96:
URL: https://github.com/apache/commons-vfs/pull/96#discussion_r465702883
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractVfsContainer.java
##########
@@ -81,11 +82,7 @@ public void close() {
}
// Close all components
- for (final Object component : toclose) {
- if (component instanceof VfsComponent) {
- final VfsComponent vfsComponent = (VfsComponent) component;
- vfsComponent.close();
- }
- }
+ Arrays.stream(toclose).filter(component -> component instanceof
VfsComponent)
+ .forEach(component -> ((VfsComponent)
component).close());
Review comment:
You're right, no need for the extra layer.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]