Author: markt Date: Sun May 24 23:08:53 2009 New Revision: 778253 URL: http://svn.apache.org/viewvc?rev=778253&view=rev Log: Correct port of fix for bug 46597. Port should not have included generics as TC4 & TC5 do not require Java 5.
Modified: tomcat/connectors/trunk/util/java/org/apache/tomcat/util/http/ServerCookie.java Modified: tomcat/connectors/trunk/util/java/org/apache/tomcat/util/http/ServerCookie.java URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/util/java/org/apache/tomcat/util/http/ServerCookie.java?rev=778253&r1=778252&r2=778253&view=diff ============================================================================== --- tomcat/connectors/trunk/util/java/org/apache/tomcat/util/http/ServerCookie.java (original) +++ tomcat/connectors/trunk/util/java/org/apache/tomcat/util/http/ServerCookie.java Sun May 24 23:08:53 2009 @@ -56,9 +56,9 @@ // Other fields private static final String OLD_COOKIE_PATTERN = "EEE, dd-MMM-yyyy HH:mm:ss z"; - private static final ThreadLocal<DateFormat> OLD_COOKIE_FORMAT = - new ThreadLocal<DateFormat>() { - protected DateFormat initialValue() { + private static final ThreadLocal OLD_COOKIE_FORMAT = + new ThreadLocal() { + protected Object initialValue() { DateFormat df = new SimpleDateFormat(OLD_COOKIE_PATTERN, Locale.US); df.setTimeZone(TimeZone.getTimeZone("GMT")); @@ -69,7 +69,8 @@ static { - ancientDate = OLD_COOKIE_FORMAT.get().format(new Date(10000)); + ancientDate = + ((DateFormat)OLD_COOKIE_FORMAT.get()).format(new Date(10000)); } /** @@ -327,7 +328,7 @@ if (maxAge == 0) buf.append( ancientDate ); else - OLD_COOKIE_FORMAT.get().format( + ((DateFormat)OLD_COOKIE_FORMAT.get()).format( new Date(System.currentTimeMillis() + maxAge*1000L), buf, new FieldPosition(0)); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org