changeset 12993:98899b2d514c

7027300: Unsynchronized HashMap access causes endless loop Reviewed-by: bae, jgodinez
author prr
date Wed, 13 Jun 2012 12:46:02 -0700
parents 8e4ff85cdd16
children a758ccd05133
files jdk/src/share/classes/sun/font/SunLayoutEngine.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/font/SunLayoutEngine.java	Thu Jun 07 18:08:28 2012 -0700
+++ b/jdk/src/share/classes/sun/font/SunLayoutEngine.java	Wed Jun 13 12:46:02 2012 -0700
@@ -33,7 +33,7 @@
 import sun.font.GlyphLayout.*;
 import java.awt.geom.Point2D;
 import java.lang.ref.SoftReference;
-import java.util.HashMap;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.Locale;
 
 /*
@@ -129,9 +129,9 @@
 
   // !!! don't need this unless we have more than one sun layout engine...
     public LayoutEngine getEngine(LayoutEngineKey key) {
-        HashMap cache = (HashMap)cacheref.get();
+        ConcurrentHashMap cache = (ConcurrentHashMap)cacheref.get();
         if (cache == null) {
-            cache = new HashMap();
+            cache = new ConcurrentHashMap();
             cacheref = new SoftReference(cache);
         }