-
Summary:
CheckIn:Fix a
thread-safe problem in flat file driver & XML driver(2.1.2)
- Bugzilla Bug (s) Resolved:
-
Description:
This
check in fix the thread-safe problem of the date/time transformation APIs in
birt.core. Before this check in is made, we use icu’s DateFormat class to
parse date strings, which is not thread-safe. The following changes are made to
ensure the thread-safety:
1. Switch for icu’s DateFormat to java.text.DateFormat. We do so
because icu 3.4.5 has bug: exception will through even different DateFormat
instance are used by each thread to parsing certain date/time string values. This
bug is an obvious conflict to icu’s java doc.
2. As java.text.DateFormat its self is not thread-safe. We create different
DateFormat instances for different thread by using java class ThreadLocal.
The
unit test cases are added as well.
- Tests Description:
Unit test.
- Files Edited:
"/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DateFormatISO8601.java"
"/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DataTypeUtil.java"
"/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DateUtil.java"
"/org.eclipse.birt.core/test/org/eclipse/birt/core/data/DataTypeUtilTest.java"
"/org.eclipse.birt.core/test/org/eclipse/birt/core/data/DateUtilTest.java"
- Files Added:
"/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DateFormatFactory.java"
"/org.eclipse.birt.core/test/org/eclipse/birt/core/data/DateUtilThreadTest.java"
- Notes to Build Team:
N/A
- Notes to Developers:
N/A
- Notes to QA:
N/A
- Notes to Documentation:
N/A