harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r529469 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/PropertyChangeSupport.java test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java
Date Tue, 17 Apr 2007 02:04:28 GMT
Author: ndbeyer
Date: Mon Apr 16 19:04:27 2007
New Revision: 529469

URL: http://svn.apache.org/viewvc?view=rev&rev=529469
Log:
Apply patch for HARMONY-1336 - [classlib][beans] unexpected IllegalArgumentException for PropertyChangeSupport.fireIndexedPropertyChange(...)

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java?view=diff&rev=529469&r1=529468&r2=529469
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
Mon Apr 16 19:04:27 2007
@@ -66,7 +66,7 @@
             Object oldValue, Object newValue) {
 
         // nulls and equals check done in doFire...
-        doFirePropertyChange(new IndexedPropertyChangeEvent(source,
+        doFirePropertyChange(new IndexedPropertyChangeEvent(sourceBean,
                 propertyName, oldValue, newValue, index));
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java?view=diff&rev=529469&r1=529468&r2=529469
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyChangeSupportTest.java
Mon Apr 16 19:04:27 2007
@@ -21,6 +21,7 @@
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeListenerProxy;
 import java.beans.PropertyChangeSupport;
+import java.beans.IndexedPropertyChangeEvent;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -553,6 +554,21 @@
 
         sup.addPropertyChangeListener("myProP", l1);
         sup.hasListeners(null);
+    }
+
+    public void testFireIndexedPropertyChange() {
+        final Object src = new Object();
+        PropertyChangeSupport pcs = new PropertyChangeSupport(src);
+        pcs.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                assertEquals(src, evt.getSource());
+                assertEquals(0, ((IndexedPropertyChangeEvent)evt).getIndex());
+                assertEquals("one", evt.getOldValue());
+                assertEquals("two", evt.getNewValue());
+            }
+        });
+
+        pcs.fireIndexedPropertyChange("foo", 0, "one", "two");
     }
 
     /*



Mime
View raw message