SimpleDateFormat « Thread Safe « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » Thread Safe » SimpleDateFormat 

1. SimpleDateFormat thread safety    stackoverflow.com

Please tell with a code example why is SimpleDateFormat not threadsafe. What is the problem in this class? Is The problem with format function of SimpleDateFormat? Please give a code which ...

2. is SimpleDateFormat thread safe    forums.oracle.com

3. SimpleDateFormat thread safety issue    forums.oracle.com

I have a servlet that instantiates an object of a class for every request in post method, which makes that variable local to that method. This class has "private final DateFormat DOB_FORMAT = new SimpleDateFormat("MM/dd/yyyy");" and a method that calls DOB_FORMAT.parse(). Even though the instance that has DOB_FORMAT is local we frequently see NumberFormatException on valid dates. So I am wondering ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.