You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2009/03/17 18:10:50 UTC

[jira] Created: (VFS-246) VfsTask.resolveFile() publishes partially constructed static object

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

                 Key: VFS-246
                 URL: https://issues.apache.org/jira/browse/VFS-246
             Project: Commons VFS
          Issue Type: Bug
            Reporter: Sebb


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.