tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50265] FormatDateSupport.dateFormatCache lazy init is not safe
Date Sat, 01 Jan 2011 20:18:29 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50265

Jeremy Boynes <jboynes@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |32311

--- Comment #1 from Jeremy Boynes <jboynes@apache.org> 2011-01-01 15:18:25 EST ---
The caching was added to resolve 32311, which was opened due to contention
issues with DateFormat.getTimeInstance() calling Calendar.getInstance() which
was synchronized. However, the synchronized keyword was removed with Java 1.4
so this should no longer be an issue for us.

#32311 also notes that the calls to format() on the cached formatters are not
thread safe and need to be synchronized; this is missing from the current
implementation. However, in many applications the date/time patterns and Locale
are likely to be the same and the cache only holds one instance of the
formatter. By synchronizing on it we will introduce a contention point just
like the the fix was trying to avoid.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message