tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Downey <steve.dow...@netfolio.com>
Subject Re: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf DateTool.java
Date Wed, 18 Sep 2002 11:49:32 GMT
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, billbarker@apache.org 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. hughjlee@yahoo.com
>
>   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:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message