# HG changeset patch # User vkarnauk # Date 1340286118 -14400 # Thu Jun 21 17:41:58 2012 +0400 # Node ID f71b6117fd7bbb13ed4c1f68ace873695edd49cb # Parent 762ae4a20c8b115e5cb486c5204d8bdee747ee59 7027300: Unsynchronized HashMap access causes endless loop Reviewed-by: bae, prr diff -r 762ae4a20c8b -r f71b6117fd7b src/share/classes/sun/font/SunLayoutEngine.java --- openjdk/jdk/src/share/classes/sun/font/SunLayoutEngine.java Thu Jun 21 14:19:12 2012 +0400 +++ openjdk/jdk/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); } # HG changeset patch # User prr # Date 1342804653 25200 # Fri Jul 20 10:17:33 2012 -0700 # Node ID 84d5cdbe7bce2caf907ec842ac7b4fa2097fb295 # Parent bf5bf37108c14d1d01b8a1043f9e3ff0e3727869 7183251: Netbeans editor renders text wrong on JDK 7u6 build Reviewed-by: igor, jgodinez diff -r bf5bf37108c1 -r 84d5cdbe7bce src/share/classes/sun/font/SunLayoutEngine.java --- openjdk/jdk/src/share/classes/sun/font/SunLayoutEngine.java Fri Jul 20 13:58:52 2012 +0400 +++ openjdk/jdk/src/share/classes/sun/font/SunLayoutEngine.java Fri Jul 20 10:17:33 2012 -0700 @@ -137,8 +137,9 @@ LayoutEngine e = (LayoutEngine)cache.get(key); if (e == null) { - e = new SunLayoutEngine(key.copy()); - cache.put(key, e); + LayoutEngineKey copy = key.copy(); + e = new SunLayoutEngine(copy); + cache.put(copy, e); } return e; }