> Using static SimpleDateFormats will probably not cause threading
> issues. Common sense says that if the set methods are never called on
> them there will be no state change that my cause sync problems. But the
> spec doesn't garuntee it. Personally I would have no problem using
> static SimpleDateFormats if this were my code.
Unfortunately common sense is of no use in this case, at least as far as
ths Sun JDK 1.2.2 goes..
For parse() and format() it uses a Calendar object (originally defined in
DateFormat) for working on. Look at the code, it's truly frightening that
somebody would choose to write it this way.
Until yesterday I would have used static SimpleDateFormat objects in my
code too.. :o(
Michael Stephenson mstephenson@openworld.co.uk
Developer - Web Applications - Open World
Tel: +44 1225 444 950 Fax: +44 1225 336 738