Static Code Review: Found static field of type java.text.DateFormat in org.sakaiproject.dav.DavServlet.HttpDateFormat
GENERAL
TESTING
GENERAL
TESTING
Description
Activity
Show:

David Horwitz April 7, 2008 at 8:13 AM
merged into 2-5-x with r45235
Fixed
Created February 22, 2008 at 12:52 PM
Updated March 27, 2012 at 6:58 AM
Resolved February 22, 2008 at 1:02 PM
Found static field of type java.text.DateFormat in org.sakaiproject.dav.DavServlet.HttpDateFormat
Found static field of type java.text.DateFormat in org.sakaiproject.dav.DavServlet.creationDateFormat
Found static field of type java.text.DateFormat in org.sakaiproject.dav.DavServlet.formats
STCAL: Static DateFormat (STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE)
As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application.
You may also experience serialization problems.
Using an instance field is recommended.
For more information on this see Sun Bug #6231579 and Sun Bug #6178997.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997