commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Created: (VFS-246) VfsTask.resolveFile() publishes partially constructed static object
Date Tue, 17 Mar 2009 17:10:50 GMT
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.


Mime
View raw message