classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] FYI: AbstractButton.getActionCommand() fixlet


From: Roman Kennke
Subject: [cp-patches] FYI: AbstractButton.getActionCommand() fixlet
Date: Thu, 14 Jul 2005 17:16:52 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

It seems that if both actionCommand and text are set to null, getActionCommand() would still return "". I implemented it this way.

2005-07-14  Roman Kennke  <address@hidden>

       * javax/swing/AbstractButton.java
       (getActionCommand): If both the actionCommand and text fields
       are null, then return "".

/Roman

Index: javax/swing/AbstractButton.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/AbstractButton.java,v
retrieving revision 1.36
diff -u -r1.36 AbstractButton.java
--- javax/swing/AbstractButton.java     13 Jul 2005 22:47:56 -0000      1.36
+++ javax/swing/AbstractButton.java     14 Jul 2005 15:14:03 -0000
@@ -608,8 +608,12 @@
   public String getActionCommand()
   {
     String ac = model.getActionCommand();
-
-    return (ac != null ? ac : text);
+    if (ac != null)
+      return ac;
+    else if (text != null)
+      return text;
+    else
+      return "";
   }
 
   /**

reply via email to

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