hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1364276 - in /httpcomponents/httpclient/trunk: RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java
Date Sun, 22 Jul 2012 12:20:27 GMT
Author: olegk
Date: Sun Jul 22 12:20:27 2012
New Revision: 1364276

URL: http://svn.apache.org/viewvc?rev=1364276&view=rev
Log:
HTTPCLIENT-1216: Added method to force clean thread-local used by DateUtils

Modified:
    httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java

Modified: httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt?rev=1364276&r1=1364275&r2=1364276&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/trunk/RELEASE_NOTES.txt Sun Jul 22 12:20:27 2012
@@ -1,3 +1,10 @@
+Changes since 4.2.1 
+-------------------
+
+* [HTTPCLIENT-1216] Added method to force clean thread-local used by DateUtils.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+
 Release 4.2.1 
 -------------------
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java?rev=1364276&r1=1364275&r2=1364276&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DateUtils.java
Sun Jul 22 12:20:27 2012
@@ -28,6 +28,7 @@
 package org.apache.http.impl.cookie;
 
 import java.lang.ref.SoftReference;
+import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
@@ -200,6 +201,15 @@ public final class DateUtils {
         return formatter.format(date);
     }
 
+    /**
+     * Clears thread-local variable containing {@link DateFormat} cache.
+     *
+     * @since 4.3
+     */
+    public static void clearThreadLocal() {
+        DateFormatHolder.clearThreadLocal();
+    }
+
     /** This class should not be instantiated. */
     private DateUtils() {
     }
@@ -254,6 +264,10 @@ public final class DateUtils {
             return format;
         }
 
+        public static void clearThreadLocal() {
+            THREADLOCAL_FORMATS.remove();
+        }
+
     }
 
 }



Mime
View raw message