#1019 concurrency issue when parsing RegularTimePeriod object

open
nobody
None
5
2012-11-27
2010-10-27
Martin Höller
No

From the JFreeChart Forum at http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=31393

I'm using JFreeChart to render multiple charts on one web page, each handled by their own http request and thus using multiple threads.
I'm not accessing the same chart from multiple threads or anything like that. The problem is just that I get unpredictable parsing errors when assembling a timeseries, more specifically when calling Day.parseDay() or Minute.parseMinute(). Since JFreeChart uses static DateFormat instances in these methods, and java.text.DateFormat is known not to be threat-safe, I consider this a bug in JFreeChart. I suggest switching to the Joda-Time framework, or using thread local DateFormat instances.

Discussion