On 29/09/2008, Mark Thomas <[EMAIL PROTECTED]> wrote: > sebb wrote: > > BTW, Commons LANG has a thread-safe FastDateUtils which can be used > > for formatting (but not parsing) dates. > > A whole jar for one method is somewhat overkill.
Indeed, but there's lots of other useful stuff in LANG. I just mentioned it in case of interest. > > Not sure why you did not just fix DateTool - e.g. by using ThreadLocal > > (or indeed synchronizing the use of DateFormats) - rather than fixing > > all calls to DateTool. > > Or maybe I've misunderstood something here. > > The class served no purpose. There aren't lots of places using this code. > > ThreadLocals and container classloader environments need careful handling > to avoid memory leaks. I would have thought that was a good reason to keep the class - one only needs to get the code right once? > In this case the pain to make sure there wasn't a memory leak wasn't worth > the gain. OK, point taken w.r.t. using synchronisation - the code should be reasonably quick. But why not use an instance variable rather than a static class variable? If there is more than 1 instance, each instance will have its own lock. Which may share the load better. > Mark > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]