Hey Roman,

On Tue, 2006-10-31 at 17:10 +0100, Roman Kennke wrote:
> I think there was a reason for that behaviour. Could you please test if
> possibly the new action command is getText() when the original command
> was null? Ideally write a Mauve test to avoid regressions.
> 
> /Roman

Yup, you are right.  When actionCommand is null, then getText() is used
instead. I have written a mauve test
(gnu.testlet.javax.swing.JTextField.fireActionPerformed) that checks
this and have committed it.

Once you give me the okay, I'll commit this patch.

Thanks,
Tania

2006-10-31  Tania Bento  <[EMAIL PROTECTED]>

        * javax/swing/JTextField.java
        (fireActionPerformed): When creating the new event, if
        actionCommand == null, then getText() is used.



Index: javax/swing/JTextField.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTextField.java,v
retrieving revision 1.33
diff -u -r1.33 JTextField.java
--- javax/swing/JTextField.java	31 Oct 2006 15:58:53 -0000	1.33
+++ javax/swing/JTextField.java	31 Oct 2006 19:34:06 -0000
@@ -270,7 +270,8 @@
    */
   protected void fireActionPerformed()
   {
-    ActionEvent event = new ActionEvent(this, 0, actionCommand);
+    ActionEvent event = new ActionEvent(this, 0, 
+                          actionCommand == null ? getText() : actionCommand);
     ActionListener[] listeners = getActionListeners();
 
     for (int index = 0; index < listeners.length; ++index)

Reply via email to