8035188: KSS: javax.swing.plaf.basic.BasicComboBoxEditor
Reviewed-by: alexsch, serb
--- 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)
}