billbarker    2002/09/17 20:50:05

  Modified:    util/java/org/apache/tomcat/util/buf DateTool.java
  Log:
  Fix thread-safe issue on date formatting.
  
  Reported by: Hugh J. L. [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.6       +2 -7      
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/DateTool.java
  
  Index: DateTool.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/DateTool.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DateTool.java     22 Mar 2002 04:12:01 -0000      1.5
  +++ DateTool.java     18 Sep 2002 03:50:04 -0000      1.6
  @@ -141,13 +141,8 @@
       // Called from MessageBytes.setTime
       /** 
        */
  -    public static String format1123( Date d ) {
  -        long dt = d.getTime() / 1000;
  -        if ((rfc1123DS != null) && (dt == rfc1123Sec))
  -            return rfc1123DS;
  -        rfc1123DS  = rfc1123Format.format( d );
  -        rfc1123Sec = dt;
  -        return rfc1123DS;
  +    public static synchronized String format1123( Date d ) {
  +     return format1123(d, rfc1123Format);
       } 
   
       public static String format1123( Date d,DateFormat df ) {
  
  
  

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

Reply via email to