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 2010/07/01 11:38:51 UTC

[jira] Created: (LANG-629) Charset may not be threadsafe, because the HashSet is not synch.

Charset may not be threadsafe, because the HashSet is not synch.
----------------------------------------------------------------

                 Key: LANG-629
                 URL: https://issues.apache.org/jira/browse/LANG-629
             Project: Commons Lang
          Issue Type: Bug
            Reporter: Sebb
             Fix For: 3.0


Charset may not be threadsafe, because the HashSet "set" is not synch.

The set is only updated by the protected add() method, which is currently only used by the protected ctors.

Given that COMMON is a synch. set, perhaps "set" should be too.

Perhaps add() should be private?



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


[jira] Closed: (LANG-629) Charset may not be threadsafe, because the HashSet is not synch.

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-629.
------------------------------

    Resolution: Fixed


I've gone with simply making the underlying set synchronized.

svn ci -m "Per LANG-629, making the underlying set synchronized for CharSet"
Sending        src/main/java/org/apache/commons/lang3/CharSet.java
Transmitting file data .
Committed revision 998000.


> Charset may not be threadsafe, because the HashSet is not synch.
> ----------------------------------------------------------------
>
>                 Key: LANG-629
>                 URL: https://issues.apache.org/jira/browse/LANG-629
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>            Reporter: Sebb
>             Fix For: 3.0
>
>
> Charset may not be threadsafe, because the HashSet "set" is not synch.
> The set is only updated by the protected add() method, which is currently only used by the protected ctors.
> Perhaps add() should be private?
> This would prevent any changes to the set after construction, and might be sufficient to ensure safe publication between threads.
> Alternatively, make the set synch, as is done for COMMON.

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


[jira] Updated: (LANG-629) Charset may not be threadsafe, because the HashSet is not synch.

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-629:
----------------------

    Description: 
Charset may not be threadsafe, because the HashSet "set" is not synch.

The set is only updated by the protected add() method, which is currently only used by the protected ctors.

Perhaps add() should be private?
This would prevent any changes to the set after construction, and might be sufficient to ensure safe publication between threads.

Alternatively, make the set synch, as is done for COMMON.



  was:
Charset may not be threadsafe, because the HashSet "set" is not synch.

The set is only updated by the protected add() method, which is currently only used by the protected ctors.

Given that COMMON is a synch. set, perhaps "set" should be too.

Perhaps add() should be private?




> Charset may not be threadsafe, because the HashSet is not synch.
> ----------------------------------------------------------------
>
>                 Key: LANG-629
>                 URL: https://issues.apache.org/jira/browse/LANG-629
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 3.0
>
>
> Charset may not be threadsafe, because the HashSet "set" is not synch.
> The set is only updated by the protected add() method, which is currently only used by the protected ctors.
> Perhaps add() should be private?
> This would prevent any changes to the set after construction, and might be sufficient to ensure safe publication between threads.
> Alternatively, make the set synch, as is done for COMMON.

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