[Lift] TimeHelpers and SimpleDateFormat

2010-01-11 Thread aw
See: http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html --- Synchronization Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized

Re: [Lift] TimeHelpers and SimpleDateFormat

2010-01-11 Thread Timothy Perrett
The whole Date class in Java is not thread safe. We considered swapping to JodaTime and I know DCB was working on it, but im not sure from the top of my head if he ever committed / merged what he was working on... Cheers, Tim On 11 Jan 2010, at 20:10, aw wrote: See:

Re: [Lift] TimeHelpers and SimpleDateFormat

2010-01-11 Thread Jeppe Nejsum Madsen
Timothy Perrett timo...@getintheloop.eu writes: The whole Date class in Java is not thread safe. We considered swapping to JodaTime and I know DCB was working on it, but im not sure from the top of my head if he ever committed / merged what he was working on... Cheers, Tim On 11 Jan

Re: [Lift] TimeHelpers and SimpleDateFormat

2010-01-11 Thread Naftoli Gugenheim
Is it a problem if two threads *read* it at the same time? Is anything being modified? - Jeppe Nejsum Madsenje...@ingolfs.dk wrote: Timothy Perrett timo...@getintheloop.eu writes: The whole Date class in Java is not thread safe. We considered swapping to

Re: [Lift] TimeHelpers and SimpleDateFormat

2010-01-11 Thread Ross Mellgren
The call to DateFormat.format mutates internal state of the DateFormat object and will cause two concurrent format calls to mix up dates that are being formatted. We've had this happen at work. I think Jeppe is probably right that it should be a def (and therefore manufacture a new format each