changeset 23693:0b8a5e89bac8

8035188: KSS: javax.swing.plaf.basic.BasicComboBoxEditor Reviewed-by: alexsch, serb
author malenkov
date Fri, 21 Mar 2014 21:47:51 +0400
parents 17d9d0dcf0c5
children a9fbe9f081cb
files jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)
                 }