Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 34007 invoked from network); 14 Mar 2009 16:02:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2009 16:02:41 -0000 Received: (qmail 81887 invoked by uid 500); 14 Mar 2009 16:02:40 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 81839 invoked by uid 500); 14 Mar 2009 16:02:40 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 81830 invoked by uid 99); 14 Mar 2009 16:02:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Mar 2009 09:02:40 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Mar 2009 16:02:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 794E223889F5; Sat, 14 Mar 2009 16:02:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r754469 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java Date: Sat, 14 Mar 2009 16:02:19 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090314160219.794E223889F5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Sat Mar 14 16:02:18 2009 New Revision: 754469 URL: http://svn.apache.org/viewvc?rev=754469&view=rev Log: Add synch for lazily created static field Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java?rev=754469&r1=754468&r2=754469&view=diff ============================================================================== --- commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java (original) +++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java Sat Mar 14 16:02:18 2009 @@ -42,7 +42,8 @@ /** Unmodifiable list of available locales. */ private static final List cAvailableLocaleList; /** Unmodifiable set of available locales. */ - private static Set cAvailableLocaleSet; + //@GuardedBy("this") + private static Set cAvailableLocaleSet; // lazily created by availableLocaleSet() /** Unmodifiable map of language locales by country. */ private static final Map cLanguagesByCountry = Collections.synchronizedMap(new HashMap()); /** Unmodifiable map of country locales by language. */ @@ -205,7 +206,7 @@ * * @return the unmodifiable set of available locales */ - public static Set availableLocaleSet() { + public static synchronized Set availableLocaleSet() { Set set = cAvailableLocaleSet; if (set == null) { set = new HashSet(availableLocaleList());