This patch mirrors that in connectors. DateTool in catalina util is largely obsolete, in any case. The patch cuts out unused code.
? share/org/apache/catalina/startup/CatalinaService.java.smd Index: share/org/apache/catalina/util/CookieTools.java =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/CookieTools.java,v retrieving revision 1.1.1.1 diff -u -w -r1.1.1.1 CookieTools.java --- share/org/apache/catalina/util/CookieTools.java 18 Jul 2002 16:47:45 -0000 1.1.1.1 +++ share/org/apache/catalina/util/CookieTools.java 18 Sep 2002 23:35:05 -0000 @@ -143,10 +143,10 @@ if (version == 0) { buf.append (";Expires="); if (cookie.getMaxAge() == 0) - DateTool.oldCookieFormat.format(new Date(10000), buf, + DateTool.formatOldCookie(new Date(10000), buf, new FieldPosition(0)); else - DateTool.oldCookieFormat.format + DateTool.formatOldCookie (new Date( System.currentTimeMillis() + cookie.getMaxAge() *1000L), buf, new FieldPosition(0)); Index: share/org/apache/catalina/util/DateTool.java =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/DateTool.java,v retrieving revision 1.1.1.1 diff -u -w -r1.1.1.1 DateTool.java --- share/org/apache/catalina/util/DateTool.java 18 Jul 2002 16:47:45 -0000 1.1.1.1 +++ share/org/apache/catalina/util/DateTool.java 18 Sep 2002 23:35:05 -0000 @@ -79,55 +79,34 @@ */ public class DateTool { - private static StringManager sm = - StringManager.getManager("org.apache.catalina.util"); - /** US locale - all HTTP dates are in english */ public final static Locale LOCALE_US = Locale.US; /** GMT timezone - all HTTP dates are on GMT */ - public final static TimeZone GMT_ZONE = TimeZone.getTimeZone("GMT"); - - /** format for RFC 1123 date string -- "Sun, 06 Nov 1994 08:49:37 GMT" - */ - public final static String RFC1123_PATTERN = - "EEE, dd MMM yyyyy HH:mm:ss z"; - - // format for RFC 1036 date string -- "Sunday, 06-Nov-94 08:49:37 GMT" - private final static String rfc1036Pattern = - "EEEEEEEEE, dd-MMM-yy HH:mm:ss z"; - - // format for C asctime() date string -- "Sun Nov 6 08:49:37 1994" - private final static String asctimePattern = - "EEE MMM d HH:mm:ss yyyyy"; + private final static TimeZone GMT_ZONE = TimeZone.getTimeZone("GMT"); /** Pattern used for old cookies */ public final static String OLD_COOKIE_PATTERN = "EEE, dd-MMM-yyyy HH:mm:ss z"; - /** DateFormat to be used to format dates - */ - public final static DateFormat rfc1123Format = - new SimpleDateFormat(RFC1123_PATTERN, LOCALE_US); - /** DateFormat to be used to format old netscape cookies */ - public final static DateFormat oldCookieFormat = + private final static DateFormat oldCookieFormat = new SimpleDateFormat(OLD_COOKIE_PATTERN, LOCALE_US); - public final static DateFormat rfc1036Format = - new SimpleDateFormat(rfc1036Pattern, LOCALE_US); - - public final static DateFormat asctimeFormat = - new SimpleDateFormat(asctimePattern, LOCALE_US); - static { - rfc1123Format.setTimeZone(GMT_ZONE); oldCookieFormat.setTimeZone(GMT_ZONE); - rfc1036Format.setTimeZone(GMT_ZONE); - asctimeFormat.setTimeZone(GMT_ZONE); + } + + public static StringBuffer formatOldCookie( + Date d, + StringBuffer buf, + FieldPosition fieldPosition) { + synchronized (oldCookieFormat) { + return oldCookieFormat.format(d, buf, fieldPosition); + } } }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>