Hi,

One more fixlet inspired by JabRef. We were calling putValue() with null
values from the constructors. JabRef has a subclass of AbstractAction
that didn't like this. This also includes one small optimization/fixlet
to not set and fire when both the old and new value of a property are
both null.

2006-02-18  Mark Wielaard  <[EMAIL PROTECTED]>

    Fixes bug #26340.
    * javax/swing/AbstractAction.java (AbstractAction()): Nothing to do.
    (AbstractAction(String)): Just call putValue() for NAME.
    (putValue): Nothing to do is old and new value are both null.

This still doesn't make JabRef work since it uses some Graphics2D stuff
which seems problematic. But we get a lot further now.

Committed,

Mark
Index: javax/swing/AbstractAction.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/AbstractAction.java,v
retrieving revision 1.18
diff -u -r1.18 AbstractAction.java
--- javax/swing/AbstractAction.java	3 Jan 2006 18:42:22 -0000	1.18
+++ javax/swing/AbstractAction.java	18 Feb 2006 15:16:45 -0000
@@ -1,5 +1,5 @@
 /* AbstractAction.java --
-   Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -74,12 +74,11 @@
   private transient HashMap store = new HashMap();
 
   /**
-   * Creates a new action with an empty string for the name.  All other 
-   * properties are initialised to <code>null</code>
+   * Creates a new action with no properties set.
    */
   public AbstractAction()
   {
-    this(null);
+    // Nothing to do.
   }
 
   /**
@@ -90,7 +89,7 @@
    */
   public AbstractAction(String name)
   {
-    this(name, null);
+    putValue(NAME, name);
   }
 
   /**
@@ -174,7 +173,7 @@
   public void putValue(String key, Object value)
   {
     Object old = getValue(key);
-    if (old == null || !old.equals(value))
+    if ((old == null && value != null) || (old != null && !old.equals(value)))
     {
       store.put(key, value);
       firePropertyChange(key, old, value);

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

Reply via email to