harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r537720 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/beancontext/BeanContextChildSupport.java test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java
Date Mon, 14 May 2007 06:10:19 GMT
Author: pyang
Date: Sun May 13 23:10:18 2007
New Revision: 537720

URL: http://svn.apache.org/viewvc?view=rev&rev=537720
Log:
Apply patch for HARMONY-3763([classlib][beans]java.beans.BeanContextChildSupport.setBeanContext(BeanContext)
does not throw PropertyVetoException while the new bean context has been vetoed against.)

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java?view=diff&rev=537720&r1=537719&r2=537720
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java
Sun May 13 23:10:18 2007
@@ -155,24 +155,28 @@
             return;
         }
 
-        releaseBeanContextResources();
+       
+        
 
         // Children are not allowed to repeatedly veto this operation.
         // So, we set rejectedSetBCOnce flag to true if veto occurs
         // and never veto the change again
         if (!this.rejectedSetBCOnce) {
 
+            this.rejectedSetBCOnce = true;
             // Validate the new BeanContext value and throw
             // PropertyVetoException if it was not successful
             if (!validatePendingSetBeanContext(bc)) {
-                this.rejectedSetBCOnce = true;
-                fireVetoableChange(BEAN_CONTEXT, this.beanContext, bc);
+                
 
                 throw new PropertyVetoException(Messages.getString("beans.0F"), //$NON-NLS-1$
                         new PropertyChangeEvent(this.beanContextChildPeer,
                                 BEAN_CONTEXT, this.beanContext, bc));
             }
+            fireVetoableChange(BEAN_CONTEXT, this.beanContext, bc);
             this.rejectedSetBCOnce = false;
+            
+            releaseBeanContextResources();
 
             // We have to notify all listeners about "beanContext"
             // property change

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java?view=diff&rev=537720&r1=537719&r2=537720
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextChildSupportTest.java
Sun May 13 23:10:18 2007
@@ -133,23 +133,10 @@
 
     public void testAddPropertyChangeListener_NullParam() {
         BeanContextChildSupport support = new MockBeanContextChildSupport();
-
-        try {
-            support.addPropertyChangeListener(null,
-                    new MockPropertyChangeListener());
-            fail();
-        } catch (NullPointerException e) {
-            // expected
-        }
-
-        try {
-            support.addPropertyChangeListener("property name", null);
-            support.firePropertyChange("property name", "old value",
-                    "new value");
-            fail();
-        } catch (NullPointerException e) {
-            // expected
-        }
+        support.addPropertyChangeListener(null, new MockPropertyChangeListener());
+        support.addPropertyChangeListener("property name", null);
+        support.firePropertyChange("property name", "old value",
+                "new value");
     }
 
     public void testAddPropertyChangeListener() {
@@ -199,23 +186,10 @@
     public void testAddVetoableChangeListener_NullParam()
             throws PropertyVetoException {
         BeanContextChildSupport support = new MockBeanContextChildSupport();
-
-        try {
-            support.addVetoableChangeListener(null,
-                    new MockVetoableChangeListener());
-            fail();
-        } catch (NullPointerException e) {
-            // expected
-        }
-
-        try {
-            support.addVetoableChangeListener("property name", null);
-            support.fireVetoableChange("property name", "old value",
-                    "new value");
-            fail();
-        } catch (NullPointerException e) {
-            // expected
-        }
+        support.addVetoableChangeListener(null,
+                new MockVetoableChangeListener());
+        support.addVetoableChangeListener("property name", null);
+        support.fireVetoableChange("property name", "old value", "new value");
     }
 
     public void testAddVetoableChangeListener() throws PropertyVetoException {



Mime
View raw message