Lucas Pouzac created CXF-6009:
---------------------------------

             Summary: Monitor contention at 
org.apache.cxf.transport.http.Headers
                 Key: CXF-6009
                 URL: https://issues.apache.org/jira/browse/CXF-6009
             Project: CXF
          Issue Type: Improvement
          Components: Transports
    Affects Versions: 3.0.1
            Reporter: Lucas Pouzac
             Fix For: 3.0.2, 3.1.0


Headers.getHttpDateFormat() indirectly calls TimeZone.getTimeZone("GMT"), which 
calls into JRE lib method causing monitor contention. See screen shot

Fix by instantiate into static variable.

{code:java}
    private static TimeZone tZone = TimeZone.getTimeZone("GMT");

    public static SimpleDateFormat getHttpDateFormat() {
        SimpleDateFormat dateFormat = 
            new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US);
        dateFormat.setTimeZone(tZone);
        return dateFormat;
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to