On 19 June 2015 at 16:16, <[email protected]> wrote:
> Author: remm
> Date: Fri Jun 19 15:16:51 2015
> New Revision: 1686432
>
> URL: http://svn.apache.org/r1686432
> Log:
> Remove unused shared formats.
>
> Modified:
> tomcat/trunk/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
>
> Modified:
> tomcat/trunk/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
> URL:
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/FastHttpDateFormat.java?rev=1686432&r1=1686431&r2=1686432&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/util/http/FastHttpDateFormat.java
> (original)
> +++ tomcat/trunk/java/org/apache/tomcat/util/http/FastHttpDateFormat.java Fri
> Jun 19 15:16:51 2015
> @@ -49,16 +49,6 @@ public final class FastHttpDateFormat {
> new SimpleDateFormat(RFC1123_DATE, Locale.US);
>
>
> - /**
> - * The set of SimpleDateFormat formats to use in getDateHeader().
> - */
> - private static final SimpleDateFormat formats[] = {
> - new SimpleDateFormat(RFC1123_DATE, 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)
> - };
> -
> -
> private static final TimeZone gmtZone = TimeZone.getTimeZone("GMT");
>
>
> @@ -66,13 +56,7 @@ public final class FastHttpDateFormat {
> * GMT timezone - all HTTP dates are on GMT
> */
> static {
> -
> format.setTimeZone(gmtZone);
> -
> - formats[0].setTimeZone(gmtZone);
> - formats[1].setTimeZone(gmtZone);
> - formats[2].setTimeZone(gmtZone);
> -
> }
>
>
> @@ -166,9 +150,6 @@ public final class FastHttpDateFormat {
> if (threadLocalformats != null) {
Does it make sense to allow null?
It won't crash, but it won't return anything useful (unless some other
caller has populated the relevant cache entry).
I would have thought it might be more useful to throw an IAE / NPE at
the start of the method if the parameter is null.
> date = internalParseDate(value, threadLocalformats);
> updateParseCache(value, date);
> - } else {
> - date = internalParseDate(value, formats);
> - updateParseCache(value, date);
> }
> if (date == null) {
> return (-1L);
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]