changeset 9583:ae7e7c69b3b6

8035188: KSS: javax.swing.plaf.basic.BasicComboBoxEditor Reviewed-by: alexsch, serb
author malenkov
date Thu, 17 Apr 2014 22:50:04 +0400
parents 441a988fee9e
children 37392f2f5d59
files src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java	Thu Apr 17 09:34:47 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java	Thu Apr 17 22:50:04 2014 +0400
@@ -32,6 +32,8 @@
 
 import java.lang.reflect.Method;
 
+import sun.reflect.misc.MethodUtil;
+
 /**
  * The default editor for editable combo boxes. The editor is implemented as a JTextField.
  *
@@ -98,8 +100,8 @@
                 // Must take the value from the editor and get the value and cast it to the new type.
                 Class<?> cls = oldValue.getClass();
                 try {
-                    Method method = cls.getMethod("valueOf", new Class[]{String.class});
-                    newValue = method.invoke(oldValue, new Object[] { editor.getText()});
+                    Method method = MethodUtil.getMethod(cls, "valueOf", new Class[]{String.class});
+                    newValue = MethodUtil.invoke(method, oldValue, new Object[] { editor.getText()});
                 } catch (Exception ex) {
                     // Fail silently and return the newValue (a String object)
                 }