8035188: KSS: javax.swing.plaf.basic.BasicComboBoxEditor
authormalenkov
Fri, 21 Mar 2014 21:47:51 +0400
changeset 23693 0b8a5e89bac8
parent 23692 17d9d0dcf0c5
child 23694 a9fbe9f081cb
8035188: KSS: javax.swing.plaf.basic.BasicComboBoxEditor Reviewed-by: alexsch, serb
jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java	Fri Mar 21 21:40:52 2014 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java	Fri Mar 21 21:47:51 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)
                 }