You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/10/23 07:24:00 UTC
[jira] [Commented] (ROL-2101) Thread unsafe use of HashMap for
cached mappings exist
[ https://issues.apache.org/jira/browse/ROL-2101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15599241#comment-15599241 ]
ASF GitHub Bot commented on ROL-2101:
-------------------------------------
GitHub user lbtc-xxx opened a pull request:
https://github.com/apache/roller/pull/5
ROL-2101 Thread unsafe use of HashMap for cached mappings exist
This fixes https://issues.apache.org/jira/browse/ROL-2101
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lbtc-xxx/roller feature/rol-2101
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/roller/pull/5.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5
----
commit f95b8bef05fccbc20cda6458df8ae3a2ef22bf2f
Author: Kohei Nozaki <ko...@apache.org>
Date: 2016-10-23T07:22:24Z
ROL-2101 Thread unsafe use of HashMap for cached mappings exist
----
> 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)