[
https://issues.apache.org/jira/browse/HTTPCORE-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505596
]
Oleg Kalnichevski commented on HTTPCORE-79:
-------------------------------------------
Folks,
In fact the static methods of DateUtils are not being used in HttpCore AT ALL.
HttpDateGenerator imports a few static variables from DateUtils, but that is it.
this.dateformat = new SimpleDateFormat(DateUtils.PATTERN_RFC1123, Locale.US);
this.dateformat.setTimeZone(DateUtils.GMT);
(1) I suggest DateUtils gets moved to HttpClient
(2) I am in favor of using ThreadLocals and SoftReferences to cache
DateFormatters, but will not stand in your way should you decide to 'borrow'
FastDateFormat from Commons Lang as long as it is not in Core
Oleg
> DateUtils should cache SimpleDateFormat
> ---------------------------------------
>
> Key: HTTPCORE-79
> URL: https://issues.apache.org/jira/browse/HTTPCORE-79
> Project: HttpComponents Core
> Issue Type: Improvement
> Components: HttpCore
> Affects Versions: 4.0-alpha5
> Reporter: Daniel Müller
> Priority: Minor
> Fix For: 4.0-beta1
>
> Attachments: org.apache.http.util.patch
>
>
> DateUtils create a SimpleDateFormat for each invocation of #formatDate and
> #parseDate. This can be optimized if SimpleDateFormat instances are cached.
> Since SimpleDateFormat is not threadsafe, the cache must be threadlocal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]