You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Emmanuel Bourg (Resolved) (JIRA)" <ji...@apache.org> on 2012/03/09 17:46:58 UTC

[jira] [Resolved] (SANDBOX-408) CSVFormat describes itself as immutable, but it is not - in particular it is not thread-safe

     [ https://issues.apache.org/jira/browse/SANDBOX-408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg resolved SANDBOX-408.
------------------------------------

       Resolution: Fixed
    Fix Version/s: CSV 1.0
    
> CSVFormat describes itself as immutable, but it is not - in particular it is not thread-safe
> --------------------------------------------------------------------------------------------
>
>                 Key: SANDBOX-408
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-408
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>            Reporter: Sebb
>             Fix For: CSV 1.0
>
>         Attachments: CSVFormat.java
>
>
> CSVFormat describes itself as immutable, but it is not @Immutable - the class fields are all mutable.
> The methods that change the fields do so by creating a clone, and returning the changed clone.
> So in a sense the class is immutable.
> However, the normal expectation is that @Immutable classes are @ThreadSafe.
> CSVFormat is not thread-safe, because the fields are not volatile, and the fields are not written & read using a common lock.
> The comment needs to be clarified or removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira