changeset 5096:f71b6117fd7b

7027300: Unsynchronized HashMap access causes endless loop Reviewed-by: bae, prr
author vkarnauk
date Thu, 21 Jun 2012 17:41:58 +0400
parents 762ae4a20c8b
children 6460dac7a299 658fdd55e71c
files src/share/classes/sun/font/SunLayoutEngine.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/font/SunLayoutEngine.java	Thu Jun 21 14:19:12 2012 +0400
+++ b/src/share/classes/sun/font/SunLayoutEngine.java	Thu Jun 21 17:41:58 2012 +0400
@@ -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);
         }