tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: svn commit: r700170 - /tomcat/tc6.0.x/trunk/STATUS.txt
Date Mon, 29 Sep 2008 18:12:43 GMT
On 29/09/2008, Mark Thomas <> 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:
>  For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message