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.