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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -58,10 +58,11 @@
         // 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) {