You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Simon Legner (JIRA)" <ji...@apache.org> on 2015/09/18 22:26:05 UTC
[jira] [Commented] (VFS-297) New instance of SftpFileSystem is
created every time due to the bug in FileSystemOptions.compareTo()
[ https://issues.apache.org/jira/browse/VFS-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14876321#comment-14876321 ]
Simon Legner commented on VFS-297:
----------------------------------
Can you please provide a code snipped which illustrates the problem?
> New instance of SftpFileSystem is created every time due to the bug in FileSystemOptions.compareTo()
> ----------------------------------------------------------------------------------------------------
>
> Key: VFS-297
> URL: https://issues.apache.org/jira/browse/VFS-297
> Project: Commons VFS
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: Kirill Safonov
>
> FileSystemOptions.compareTo() uses TreeMap's hashcode. This is not appropriate if map contains array instances since Array's equals() merely checks == (so that {{new Array[0].equals(new Array[0])}} is false).
> So when I configure FileSystemOptions like {{SftpFileSystemConfigBuilder.getInstance().setIdentities(options, new File[]{new File(privateKeyFile)})}} I never get filesystem instance reused.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)