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

Make constructor FileSystemOptions(Map) public

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.9.0
    • 2.10.0
    • None

    Description

      Problem:

      The map `org.apache.commons.vfs2.FileSystemOptions#options` is TreeMap. The datastructure is  not thread-safe and resulting in situations like this  when used in multithreaded environments.

      Workaround:

      As a workaround, we have to synchronize the `FileSystemOptions` in all the places of the code. 

      Solution:

      •  If there is no issue, the constructor `

      protected FileSystemOptions(Map<FileSystemOptionKey, Object> options)` can be made public, so that users will have an option to pass a synchronized map when they have to. * Or, wrap the `TreeMap` instance with `java.util.Collections#synchronizedMap`, ensuring thread safety at the core.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kannangce Kannan Ramamoorthy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: