src/share/classes/javax/swing/plaf/synth/ImagePainter.java

Print this page

        

*** 58,67 **** --- 58,68 ---- // cache to be shared by all, and we don't use a static because we // don't want it to persist between look and feels. For that reason // we use a AppContext specific Paint9Painter. It's backed via // a WeakRef so that it can go away if the look and feel changes. synchronized(CACHE_KEY) { + @SuppressWarnings("unchecked") WeakReference<Paint9Painter> cacheRef = (WeakReference<Paint9Painter>)AppContext.getAppContext(). get(CACHE_KEY); Paint9Painter painter; if (cacheRef == null || (painter = cacheRef.get()) == null) {