changeset 25087:dc3f3f90567f

8043151: KSS: javax.swing.plaf.nimbus.AbstractRegionPainter#getComponentColor Reviewed-by: alexsch, serb
author malenkov
date Fri, 16 May 2014 15:46:24 +0400
parents a43e10e7f3a6
children 8d4b058368f0
files jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java	Tue May 13 10:29:12 2014 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java	Fri May 16 15:46:24 2014 +0400
@@ -31,6 +31,7 @@
 import javax.swing.plaf.UIResource;
 import javax.swing.Painter;
 import java.awt.print.PrinterGraphics;
+import sun.reflect.misc.MethodUtil;
 
 /**
  * Convenient base class for defining Painter instances for rendering a
@@ -445,8 +446,8 @@
             } else {
                 String s = "get" + Character.toUpperCase(property.charAt(0)) + property.substring(1);
                 try {
-                    Method method = c.getClass().getMethod(s);
-                    color = (Color) method.invoke(c);
+                    Method method = MethodUtil.getMethod(c.getClass(), s, null);
+                    color = (Color) MethodUtil.invoke(method, c, null);
                 } catch (Exception e) {
                     //don't do anything, it just didn't work, that's all.
                     //This could be a normal occurance if you use a property