Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9095183EB for ; Mon, 9 Nov 2015 13:20:56 +0000 (UTC) Received: (qmail 43264 invoked by uid 500); 9 Nov 2015 13:20:56 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 43222 invoked by uid 500); 9 Nov 2015 13:20:56 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 43213 invoked by uid 99); 9 Nov 2015 13:20:56 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2015 13:20:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 25A09C0473 for ; Mon, 9 Nov 2015 13:20:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.991 X-Spam-Level: X-Spam-Status: No, score=0.991 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id RvKBTA46c0qQ for ; Mon, 9 Nov 2015 13:20:50 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 5892B24E9F for ; Mon, 9 Nov 2015 13:20:49 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 87168E043E for ; Mon, 9 Nov 2015 13:20:48 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 644D53A071A for ; Mon, 9 Nov 2015 13:20:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1713430 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/DateUtils.java Date: Mon, 09 Nov 2015 13:20:48 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151109132048.644D53A071A@svn01-us-west.apache.org> Author: olegk Date: Mon Nov 9 13:20:47 2015 New Revision: 1713430 URL: http://svn.apache.org/viewvc?rev=1713430&view=rev Log: HTTPCLIENT-1216: removed ThreadLocal subclass from DateUtils Contributed by Jochen Kemnade Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/DateUtils.java Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/DateUtils.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/DateUtils.java?rev=1713430&r1=1713429&r2=1713430&view=diff ============================================================================== --- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/DateUtils.java (original) +++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/DateUtils.java Mon Nov 9 13:20:47 2015 @@ -200,15 +200,7 @@ public final class DateUtils { final static class DateFormatHolder { private static final ThreadLocal>> - THREADLOCAL_FORMATS = new ThreadLocal>>() { - - @Override - protected SoftReference> initialValue() { - return new SoftReference>( - new HashMap()); - } - - }; + THREADLOCAL_FORMATS = new ThreadLocal<>(); /** * creates a {@link SimpleDateFormat} for the requested format string. @@ -224,7 +216,7 @@ public final class DateUtils { */ public static SimpleDateFormat formatFor(final String pattern) { final SoftReference> ref = THREADLOCAL_FORMATS.get(); - Map formats = ref.get(); + Map formats = ref == null ? null : ref.get(); if (formats == null) { formats = new HashMap<>(); THREADLOCAL_FORMATS.set(