At 09:39 AM 12/24/2004, Curt Arnold wrote:
I've reworked your rework of CachedDateFormat.

Yes, thank you. Comments below.

Hopefully we can take a break for a few days.

Agreed.

I've added tests to check all the previously misinterpreted patterns.
The previous tricks of using "SS0" and were actually easier to catch using the length of the string changes

Although it was used in my earlier tests, "SS0" is not a very plausible format string, double and especially a single 'S' are more plausible. (Single 'S' means "print the millisecond field 'as is', with no padding").


between the evaluation at the integral second and the magic millisecond counts. I was going to say that I couldn't think of a trick to play on the caching at this time, but then I thought of one and will commit a fix in just a second.
Hopefully, I've cut down the creation of Date's even more than your last iteration. I haven't single stepped through the code or ran any performance tests. If I missed something simple, please feel free to tweak it, but let's confer before you do any major surgery.

It looks like you are no longer taking advantage of the case where there is no millisecond field to print, in which case millisecond formatting and findMillisecondStart calculations can be skipped.


I noticed that you had removed checks for pre-1970 dates. I had a test that was should have failed but didn't which I have now repaired.
Obviously it should be rare that anyone sets their system time back 35 years, but I'd like the cache to be able to handle if somebody uses it in a different context.

There are many other places where we assume that the environment in which log4j runs, has time set to a date later than 1970. Pretending that we support times earlier than 1970 makes the code harder to understand and to maintain. Unless you feel strongly about it, my preference is to have the pre-1970 checks removed.



-- Ceki G�lc�

  The complete log4j manual: http://qos.ch/log4j/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to