8378192: Remove AppContext from SwingUtilities2

Reviewed-by: psadhukhan, kizune
This commit is contained in:
Phil Race 2026-02-19 18:04:06 +00:00
parent 9b44ea39bf
commit 2a71f89bc8

View File

@ -92,7 +92,6 @@ import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import sun.awt.AWTAccessor;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
import sun.font.FontDesignMetrics;
import sun.font.FontUtilities;
@ -1241,7 +1240,7 @@ public class SwingUtilities2 {
return null;
}
private static final Object APP_CONTEXT_FRC_CACHE_KEY = new Object();
private static final Map<Object, FontRenderContext> cache = new HashMap<>();
private static FontRenderContext getFRCFromCache(AffineTransform tx,
Object aaHint) {
@ -1249,15 +1248,6 @@ public class SwingUtilities2 {
return null;
}
@SuppressWarnings("unchecked")
Map<Object, FontRenderContext> cache = (Map<Object, FontRenderContext>)
AppContext.getAppContext().get(APP_CONTEXT_FRC_CACHE_KEY);
if (cache == null) {
cache = new HashMap<>();
AppContext.getAppContext().put(APP_CONTEXT_FRC_CACHE_KEY, cache);
}
Object key = (tx == null)
? aaHint
: (aaHint == null ? tx : new KeyPair(tx, aaHint));