harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r397072 - in /incubator/harmony/enhanced/classlib/trunk/modules/beans: make/common/build.xml src/main/java/java/beans/PropertyChangeListenerProxy.java src/test/java/tests/api/java/beans/PropertyChangeListenerProxyTest.java
Date Wed, 26 Apr 2006 03:48:52 GMT
Author: mloenko
Date: Tue Apr 25 20:48:50 2006
New Revision: 397072

URL: http://svn.apache.org/viewcvs?rev=397072&view=rev
Log:
fixes for HARMONY-407
java.beans.PropertyChangeListenerProxy.propertyChange(PropertyChangeEvent evt) does not throw
NPE when RI does

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeListenerProxy.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeListenerProxyTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml?rev=397072&r1=397071&r2=397072&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml Tue Apr
25 20:48:50 2006
@@ -117,7 +117,6 @@
                     <exclude name="tests/api/java/beans/MethodDescriptorTest.java" />
                     <exclude name="tests/api/java/beans/PersistenceDelegateTest.java"
/>
                     <exclude name="tests/api/java/beans/PropertyChangeEventTest.java"
/>
-                    <exclude name="tests/api/java/beans/PropertyChangeListenerProxyTest.java"
/>
                     <exclude name="tests/api/java/beans/PropertyChangeSupportTest.java"
/>
                     <exclude name="tests/api/java/beans/PropertyDescriptorTest.java" />
                     <exclude name="tests/api/java/beans/PropertyEditorManagerTest.java"
/>

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeListenerProxy.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeListenerProxy.java?rev=397072&r1=397071&r2=397072&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeListenerProxy.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeListenerProxy.java
Tue Apr 25 20:48:50 2006
@@ -54,8 +54,6 @@
     public void propertyChange(PropertyChangeEvent event) {
         PropertyChangeListener listener =
             (PropertyChangeListener) getListener();
-        if (listener != null) {
-            listener.propertyChange(event);
-        }
+        listener.propertyChange(event);
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeListenerProxyTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeListenerProxyTest.java?rev=397072&r1=397071&r2=397072&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeListenerProxyTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeListenerProxyTest.java
Tue Apr 25 20:48:50 2006
@@ -39,10 +39,6 @@
 		proxy = new PropertyChangeListenerProxy(name, listener);
 	}
 
-	protected void tearDown() throws Exception {
-		super.tearDown();
-	}
-
 	public void testPropertyChangeListenerProxy() {
 		proxy = new PropertyChangeListenerProxy(null, listener);
 		assertSame(listener, proxy.getListener());
@@ -57,7 +53,7 @@
 		try {
 			proxy.propertyChange(new PropertyChangeEvent(new Object(), "name",
 					new Object(), new Object()));
-			fail("should null pointer");
+            fail("NullPointerException expected");
 		} catch (NullPointerException e) {
 		}
 
@@ -76,7 +72,19 @@
 		assertNull(event);
 	}
 
-	public static class MockPropertyChangeListener implements
+    /**
+     * Regression for HARMONY-407
+     */
+    public void testPropertyChange_PropertyChangeEvent() {
+        PropertyChangeListenerProxy proxy = new PropertyChangeListenerProxy(
+                "harmony", null);
+        try {
+            proxy.propertyChange(null);
+            fail("NullPointerException expected");
+        } catch (NullPointerException e) {}
+    }         
+
+    public static class MockPropertyChangeListener implements
 			PropertyChangeListener {
 		public void propertyChange(PropertyChangeEvent newevent) {
 			event = newevent;



Mime
View raw message