commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <>
Subject [jira] [Work logged] (BEANUTILS-402) Double-Checked Locking anti pattern in WeakFastHashMap
Date Wed, 23 Oct 2019 15:44:00 GMT


ASF GitHub Bot logged work on BEANUTILS-402:

                Author: ASF GitHub Bot
            Created on: 23/Oct/19 15:43
            Start Date: 23/Oct/19 15:43
    Worklog Time Spent: 10m 
      Work Description: melloware commented on pull request #15: [BEANUTILS-402] Double-Checked
Locking anti pattern in WeakFastHashMap.
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

Issue Time Tracking

            Worklog Id:     (was: 332645)
    Remaining Estimate: 0h
            Time Spent: 10m

> Double-Checked Locking anti pattern in WeakFastHashMap
> ------------------------------------------------------
>                 Key: BEANUTILS-402
>                 URL:
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils, ConvertUtils &amp; Converters, Locale
BeanUtils / Converters
>    Affects Versions: 1.8.3
>         Environment: Win XP, but doesn't matter
>            Reporter: Volker Malzahn
>            Priority: Major
>             Fix For: 2.0.0
>          Time Spent: 10m
>  Remaining Estimate: 0h
> The implementation of WeakFastHashMap has the flaw of implementing the Double-Checked
Locking anti pattern (see JavaDoc of that class). As described in the JavaDoc "This class
is not cross-platform.". In and
this was solved for MethodUtils (usage of WeakFastHashMap). But following classes still use
WeakFastHashMap for a cache: BeanUtils, ConvertUtilsBean, PropertyUtilsBean, LocaleConvertUtilsBean.
> I would suggest to make WeakFastHashMap deprecated and to change every usage of that
class inside the commons-beanutils classes to a synchronized normal WeakHashMap like done
(as the second step) in Otherwise strange
things may happen in unusual plattforms/environments. An alternative could be to use "volatile"
inside WeakFastHashMap which would fix it for Java 5 and higher (see

This message was sent by Atlassian Jira

View raw message