Hi,

The JOptionPane.showInputDialog(Component, Object, String, int, Icon,
Object[], Object) and the internalShowInputDialog version were casting
the return value to a String, but since it returns an Object this was
just wrong. All other variants of [internal]showInputDialog() do return
Strings so this was probably just a copy/paste error.

2005-10-05  Mark Wielaard  <[EMAIL PROTECTED]>

    * javax/swing/JOptionPane.java
    (showInputDialog(Component,Object,String,int,Icon,Object[],Object)):
    Don't cast return value.
    (internalShowInputDialog(Component,Object,String,int,Icon,Object[],
     Object)): Likewise.

Found by running pollo.

Committed,

Mark
Index: javax/swing/JOptionPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JOptionPane.java,v
retrieving revision 1.19
diff -u -r1.19 JOptionPane.java
--- javax/swing/JOptionPane.java	3 Oct 2005 15:23:44 -0000	1.19
+++ javax/swing/JOptionPane.java	5 Oct 2005 17:31:10 -0000
@@ -1059,7 +1059,7 @@
     dialog.pack();
     dialog.show();
     
-    return (String) pane.getInputValue();
+    return pane.getInputValue();
   }
 
   /**
@@ -1298,7 +1298,7 @@
 
     startModal(frame);
     
-    return (String) pane.getInputValue();
+    return pane.getInputValue();
   }
 
   /**

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to