Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[birt-dev] CheckIn:Fix thread-safe problem of birt core data convert api.

-          Summary:

CheckIn:Fix thread-safe problem of birt core data convert api.

- Bugzilla Bug (s) Resolved: 

-          Description:

This check in fix the thread-safe problem of the date/time transformation methods  in org.eclipse.birt.core.data. 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/DateUtil.java

/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DataTypeUtil.java

/org.eclipse.birt.core.tests/test/org/eclipse/birt/core/data/DateUtilTest.java

/org.eclipse.birt.core.tests/test/org/eclipse/birt/core/data/DataTypeUtilTest.java

 

- Files Added:

/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DateFormatFactory.java

/org.eclipse.birt.core.tests/test/org/eclipse/birt/core/data/DateUtilThreadTest.java

 

- Files Deleted:

N/A

 

- Notes to Build Team:
N/A


- Notes to Developers:
N/A


- Notes to QA: 
 

N/A

 

- Notes to Documentation:  
N/A

 

 

 

 

 


Back to the top