Author: remy.maucherat(a)jboss.com
Date: 2010-10-26 09:37:40 -0400 (Tue, 26 Oct 2010)
New Revision: 1566
Modified:
trunk/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
Log:
- Port patch, supposedly improving sync.
Modified: trunk/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/FastHttpDateFormat.java 2010-10-25 08:24:25 UTC
(rev 1565)
+++ trunk/java/org/apache/tomcat/util/http/FastHttpDateFormat.java 2010-10-26 13:37:40 UTC
(rev 1566)
@@ -36,28 +36,28 @@
// -------------------------------------------------------------- Variables
- protected static final int CACHE_SIZE =
+ private static final int CACHE_SIZE =
Integer.parseInt(System.getProperty("org.apache.tomcat.util.http.FastHttpDateFormat.CACHE_SIZE",
"1000"));
/**
* HTTP date format.
*/
- protected static final SimpleDateFormat format =
+ private static final SimpleDateFormat format =
new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US);
/**
* The set of SimpleDateFormat formats to use in getDateHeader().
*/
- protected static final SimpleDateFormat formats[] = {
+ private static final SimpleDateFormat formats[] = {
new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US),
new SimpleDateFormat("EEEEEE, dd-MMM-yy HH:mm:ss zzz", Locale.US),
new SimpleDateFormat("EEE MMMM d HH:mm:ss yyyy", Locale.US)
};
- protected final static TimeZone gmtZone = TimeZone.getTimeZone("GMT");
+ private final static TimeZone gmtZone = TimeZone.getTimeZone("GMT");
/**
@@ -77,26 +77,26 @@
/**
* Instant on which the currentDate object was generated.
*/
- protected static long currentDateGenerated = 0L;
+ private static long currentDateGenerated = 0L;
/**
* Current formatted date.
*/
- protected static String currentDate = null;
+ private static String currentDate = null;
/**
* Formatter cache.
*/
- protected static final ConcurrentHashMap<Long, String> formatCache =
+ private static final ConcurrentHashMap<Long, String> formatCache =
new ConcurrentHashMap<Long, String>(CACHE_SIZE);
/**
* Parser cache.
*/
- protected static final ConcurrentHashMap<String, Long> parseCache =
+ private static final ConcurrentHashMap<String, Long> parseCache =
new ConcurrentHashMap<String, Long>(CACHE_SIZE);
@@ -112,8 +112,8 @@
if ((now - currentDateGenerated) > 1000) {
synchronized (format) {
if ((now - currentDateGenerated) > 1000) {
+ currentDate = format.format(new Date(now));
currentDateGenerated = now;
- currentDate = format.format(new Date(now));
}
}
}
Show replies by date