classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: JOptionPane.showInputDialog() doesn't need to cast ret


From: Mark Wielaard
Subject: [cp-patches] FYI: JOptionPane.showInputDialog() doesn't need to cast return value
Date: Wed, 05 Oct 2005 19:31:53 +0200

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  <address@hidden>

    * 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]