commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r905671 - /commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/CharSet.java
Date Tue, 02 Feb 2010 15:25:45 GMT
Author: niallp
Date: Tue Feb  2 15:25:14 2010
New Revision: 905671

URL: http://svn.apache.org/viewvc?rev=905671&view=rev
Log:
Port LANG-494 to 2.x branch - Synchronizing the COMMON Map so that getInstance doesn't miss
a put from a subclass in another thread.

Modified:
    commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/CharSet.java

Modified: commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/CharSet.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/CharSet.java?rev=905671&r1=905670&r2=905671&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/CharSet.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/CharSet.java
Tue Feb  2 15:25:14 2010
@@ -17,6 +17,7 @@
 package org.apache.commons.lang;
 
 import java.io.Serializable;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -79,7 +80,7 @@
      * Subclasses can add more common patterns if desired
      * @since 2.0
      */
-    protected static final Map COMMON = new HashMap();
+    protected static final Map COMMON = Collections.synchronizedMap(new HashMap());
     
     static {
         COMMON.put(null, EMPTY);



Mime
View raw message