-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all, hi Tom.

I checked this in:

2005-11-30  Robert Schuster  <[EMAIL PROTECTED]>

        * java/beans/PropertyChangeSupport.java:
        (fireIndexedPropertyChange): Removed argument checking.

Tom Tromey wrote:
> I'm checking this in.
> 
> +  public void fireIndexedPropertyChange(String name, int index,
> +                                        Object oldValue, Object newValue)
> +  {
> +    // FIXME: should we use equals() here?
> +    if (oldValue == newValue && oldValue != null)
> +      firePropertyChange(new IndexedPropertyChangeEvent(source, name,
> +                                                        oldValue, newValue,
> +                                                        index));
> +  }
At first the check is not necessary because it is done in firePropertyChange.
And the '==' must be a typo here. You only fire the event when the objects are
equal and are non-null ...).

It is important to give the objects the chance to make their own equality test.

The first line in firePropertyChange(PropertyChangeEvent) does that in a very
nice way:

if (event.oldValue != null && event.oldValue.equals(event.newValue))
      return;

cya
Robert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDjYwkG9cfwmwwEtoRAnOjAJ9viysessPhVIDF+c2VHu7Nr3+WogCfQ6v8
AmG8cS1palTVKOZW7CjhN0k=
=8QWs
-----END PGP SIGNATURE-----
Index: java/beans/PropertyChangeSupport.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/beans/PropertyChangeSupport.java,v
retrieving revision 1.12
diff -u -r1.12 PropertyChangeSupport.java
--- java/beans/PropertyChangeSupport.java	27 Nov 2005 14:57:19 -0000	1.12
+++ java/beans/PropertyChangeSupport.java	30 Nov 2005 11:17:04 -0000
@@ -408,11 +408,9 @@
   public void fireIndexedPropertyChange(String name, int index,
                                         Object oldValue, Object newValue)
   {
-    // FIXME: should we use equals() here?
-    if (oldValue == newValue && oldValue != null)
+      // Argument checking is done in firePropertyChange(PropertyChangeEvent) .
       firePropertyChange(new IndexedPropertyChangeEvent(source, name,
                                                         oldValue, newValue,
-                                                        index));
   }
 
   /**
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to