james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwiederk...@apache.org
Subject svn commit: r738881 - /james/mime4j/trunk/src/main/java/org/apache/james/mime4j/util/MimeUtil.java
Date Thu, 29 Jan 2009 15:10:43 GMT
Author: mwiederkehr
Date: Thu Jan 29 15:10:42 2009
New Revision: 738881

URL: http://svn.apache.org/viewvc?rev=738881&view=rev
Log:
explicitly set default time zone because DateFormat is kept in a ThreadLocal

Modified:
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/util/MimeUtil.java

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/util/MimeUtil.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/util/MimeUtil.java?rev=738881&r1=738880&r2=738881&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/util/MimeUtil.java (original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/util/MimeUtil.java Thu Jan 29
15:10:42 2009
@@ -411,9 +411,13 @@
      */
     public static String formatDate(Date date, TimeZone zone) {
         DateFormat df = RFC822_DATE_FORMAT.get();
-        if (zone != null) {
+
+        if (zone == null) {
+            df.setTimeZone(TimeZone.getDefault());
+        } else {
             df.setTimeZone(zone);
         }
+
         return df.format(date);
     }
 



Mime
View raw message