That seems to be substantially upping the complexity of CachedDateFormat. It seemed a lot simpler to protect against that weakness by checking for it DatePatternConverter. Something like:

    try {
     if (pattern.indexOf("S") == -1 || pattern.indexOf("SSS") != -1) {
          df = new CachedDateFormat(SimpleDateFormat(pattern));
     } else {
          df = new SimpleDateFormat(pattern);
    }

    } catch (IllegalArgumentException e) {

Also, the slot stuff also seemed to up the complexity. I was trying to make it simpler at some trival cost (an extra dateformat per second or so) and still avoid the migrating millisecond field problem, I thought that I had adequately addressed that weakness.


On Dec 23, 2004, at 11:39 AM, [EMAIL PROTECTED] wrote:

ceki        2004/12/23 09:39:18

Modified: src/java/org/apache/log4j/pattern CachedDateFormat.java
tests/src/java/org/apache/log4j/pattern
CachedDateFormatTest.java
Log:
Caching does not work for patterns containing 1 or two 2 'S'. However, it works for 0 or 3 or more 'S'.




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



Reply via email to