harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r395772 - in /incubator/harmony/enhanced/classlib/trunk/modules/beans: make/common/ src/main/java/java/beans/ src/test/java/org/apache/harmony/tests/java/beans/ src/test/java/tests/api/java/beans/
Date Fri, 21 Apr 2006 04:05:22 GMT
Author: smishura
Date: Thu Apr 20 21:05:21 2006
New Revision: 395772

URL: http://svn.apache.org/viewcvs?rev=395772&view=rev
Log:
Fix for HARMONY-227 (PropertyChangeSupport constructor should throw NullPointerException)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/make/common/build.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/tests/java/beans/PropertyChangeSupportTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeSupportTest.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=395772&r1=395771&r2=395772&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 Thu Apr
20 21:05:21 2006
@@ -102,7 +102,6 @@
                     <exclude name="**/BeanContextServicesSupportTest.java" />
                     <exclude name="**/BeanContextSupportTest.java" />
                     <exclude name="**/EventHandlerTest.java" />
-                    <exclude name="**/PropertyChangeSupportTest.java" />
                     <exclude name="**/SimpleBeanInfoTest.java" />
                     <exclude name="**/VetoableChangeSupportTest.java" />
 
@@ -120,6 +119,7 @@
                     <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"
/>
                     <exclude name="tests/api/java/beans/PropertyEditorSupportTest.java"
/>

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java?rev=395772&r1=395771&r2=395772&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
Thu Apr 20 21:05:21 2006
@@ -52,6 +52,9 @@
      * @com.intel.drl.spec_ref
      */
     public PropertyChangeSupport(Object sourceBean) {
+        if (sourceBean == null) {
+            throw new NullPointerException();
+        }
         this.sourceBean = sourceBean;
     }
 
@@ -255,7 +258,7 @@
         oos.writeObject(children);
         
         Object source = null;
-        if((sourceBean != null) && (sourceBean instanceof Serializable)) {
+        if(sourceBean instanceof Serializable) {
             source = sourceBean;
         }
         oos.writeObject(source);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/tests/java/beans/PropertyChangeSupportTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/tests/java/beans/PropertyChangeSupportTest.java?rev=395772&r1=395771&r2=395772&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/tests/java/beans/PropertyChangeSupportTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/tests/java/beans/PropertyChangeSupportTest.java
Thu Apr 20 21:05:21 2006
@@ -57,7 +57,21 @@
     public PropertyChangeSupportTest(String name) {
         super(name);
     }
-    
+
+    /**
+     * @tests java.beans.PropertyChangeSupport#PropertyChangeSupport(
+     *        java.lang.Object)
+     */
+    public void testConstructor_Null() {
+        try {
+            // Regression for HARMONY-227
+            new PropertyChangeSupport(null);
+            fail("Should throw NullPointerException!");
+        } catch (NullPointerException ex) {
+            // expected
+        }
+    }
+
     /**
      * The test checks the serialization for listeners supporting serialization
      */

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeSupportTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeSupportTest.java?rev=395772&r1=395771&r2=395772&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeSupportTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/tests/api/java/beans/PropertyChangeSupportTest.java
Thu Apr 20 21:05:21 2006
@@ -39,18 +39,6 @@
 	}
 
 	/*
-	 * Test the constructor with a null parameter.
-	 */
-	public void testConstructor_Null() {
-		try {
-			new PropertyChangeSupport(null);
-			fail("Should throw NullPointerException!");
-		} catch (NullPointerException ex) {
-			// expected
-		}
-	}
-
-	/*
 	 * Test the method addPropertyChangeListener(PropertyeChangeListener) with a
 	 * normal listener parameter.
 	 */



Mime
View raw message