I think that should probably be public static String format1123( Date d ) { synchronized(rfc1123Format) { return format1123(d, rfc1123Format); } }
Synching on 'this' is overkill. On Tuesday 17 September 2002 11:50 pm, [EMAIL PROTECTED] wrote: > 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.jav >a > > Index: DateTool.java > =================================================================== > RCS file: > /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/Da >teTool.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]>