tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r699714 - /tomcat/trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
Date Sat, 27 Sep 2008 18:34:06 GMT
Author: markt
Date: Sat Sep 27 11:34:06 2008
New Revision: 699714

URL: http://svn.apache.org/viewvc?rev=699714&view=rev
Log:
Fix date format issue reported by Find Bugs.

Modified:
    tomcat/trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java

Modified: tomcat/trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java?rev=699714&r1=699713&r2=699714&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ssi/ResponseIncludeWrapper.java Sat Sep 27 11:34:06
2008
@@ -20,6 +20,8 @@
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 
 import javax.servlet.ServletContext;
 import javax.servlet.ServletOutputStream;
@@ -42,6 +44,8 @@
      */
     private static final String CONTENT_TYPE = "content-type";
     private static final String LAST_MODIFIED = "last-modified";
+    private static final DateFormat format =
+        new SimpleDateFormat(DateTool.RFC1123_PATTERN, DateTool.LOCALE_US);
     protected long lastModified = -1;
     private String contentType = null;
 
@@ -208,7 +212,9 @@
         String lname = name.toLowerCase();
         if (lname.equals(LAST_MODIFIED)) {
             try {
-                lastModified = DateTool.rfc1123Format.parse(value).getTime();
+                synchronized(format) {
+                    lastModified = format.parse(value).getTime();
+                }
             } catch (Throwable ignore) { }
         } else if (lname.equals(CONTENT_TYPE)) {
             contentType = value;
@@ -228,7 +234,9 @@
         String lname = name.toLowerCase();
         if (lname.equals(LAST_MODIFIED)) {
             try {
-                lastModified = DateTool.rfc1123Format.parse(value).getTime();
+                synchronized(format) {
+                    lastModified = format.parse(value).getTime();
+                }
             } catch (Throwable ignore) { }
         }
         else if (lname.equals(CONTENT_TYPE))



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message