roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kohei Nozaki (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ROL-2101) Thread unsafe use of HashMap for cached mappings exist
Date Mon, 11 Jan 2016 02:53:39 GMT

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

Kohei Nozaki updated ROL-2101:
------------------------------
    Attachment: ROL-2101.patch

Wrapped by {{Collections.synchronizedMap}} .

> Thread unsafe use of HashMap for cached mappings exist
> ------------------------------------------------------
>
>                 Key: ROL-2101
>                 URL: https://issues.apache.org/jira/browse/ROL-2101
>             Project: Apache Roller
>          Issue Type: Bug
>          Components: Data Model & JPA Backend
>    Affects Versions: 5.1.2
>            Reporter: Kohei Nozaki
>            Assignee: Roller Unassigned
>            Priority: Minor
>         Attachments: ROL-2101.patch
>
>
> There are two singleton classes that have a instance field type of {{HashMap}} for cache.
> In {{JPAUserManagerImpl}}:
> {noformat}
> // cached mapping of userNames -> userIds
> private Map<String, String> userNameToIdMap = new HashMap<String, String>();
> {noformat}
> In {{JPAWeblogEntryManagerImpl}}:
> {noformat}
> // cached mapping of entryAnchors -> entryIds
> private Map<String, String> entryAnchorToIdMap = new HashMap<String, String>();
> {noformat}
> {{HashMap}} s should not be used as the above because it's not thread safe.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message