--- old/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java 2014-07-02 23:02:25.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java 2014-07-02 23:02:24.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -50,15 +50,20 @@ this.key = key; } + @SuppressWarnings("unchecked") + private static Painter paintFilter(@SuppressWarnings("rawtypes") Painter painter) { + return (Painter) painter; + } + @Override public void paintIcon(SynthContext context, Graphics g, int x, int y, int w, int h) { - Painter painter = null; + Painter painter = null; if (context != null) { - painter = (Painter)context.getStyle().get(context, key); + painter = paintFilter((Painter)context.getStyle().get(context, key)); } if (painter == null){ - painter = (Painter) UIManager.get(prefix + "[Enabled]." + key); + painter = paintFilter((Painter)UIManager.get(prefix + "[Enabled]." + key)); } if (painter != null && context != null) { @@ -140,7 +145,8 @@ */ @Override public void paintIcon(Component c, Graphics g, int x, int y) { - Painter painter = (Painter)UIManager.get(prefix + "[Enabled]." + key); + Painter painter = + paintFilter((Painter)UIManager.get(prefix + "[Enabled]." + key)); if (painter != null){ JComponent jc = (c instanceof JComponent) ? (JComponent)c : null; Graphics2D gfx = (Graphics2D)g;