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

VfsTask.resolveFile() publishes partially constructed static object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      VfsTask.resolveFile() publishes a partially constructed static object.

      The static "manager" field is created and then updated; this is not thread-safe.

      A work-round is to use a temporary variable and then assign it to the static field once init. is complete.
      However that is still not thread-safe.

      Consider using the "Initialization On Demand Holder" idiom, though this will mean a change to close() as the manager variable would no longer be accessible.
      However, it appears that the manager.close() method is re-usable.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: