Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-297

New instance of SftpFileSystem is created every time due to the bug in FileSystemOptions.compareTo()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joehni Joerg Schaible
                Reporter:
                ksafonov Kirill Safonov
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: