harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r548641 - /harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java
Date Tue, 19 Jun 2007 08:01:10 GMT
Author: leoli
Date: Tue Jun 19 01:01:09 2007
New Revision: 548641

URL: http://svn.apache.org/viewvc?view=rev&rev=548641
Log:
Fix bugs in java.beans.beancontext.BeanContextChildSupport.

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.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=548641&r1=548640&r2=548641
==============================================================================
--- 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
Tue Jun 19 01:01:09 2007
@@ -46,6 +46,8 @@
     protected transient boolean rejectedSetBCOnce;
 
     protected VetoableChangeSupport vcSupport;
+    
+    private transient BeanContext lastVetoedContext;
 
     public BeanContextChildSupport() {
         // This class implements the JavaBean component itself
@@ -81,6 +83,7 @@
         }
 
         this.vcSupport.addVetoableChangeListener(name, vcl);
+        this.lastVetoedContext = null;
     }
 
     public void firePropertyChange(String name, Object oldValue, Object newValue) {
@@ -127,6 +130,7 @@
             VetoableChangeListener vcl) {
 
         this.vcSupport.removeVetoableChangeListener(name, vcl);
+        this.lastVetoedContext = null;
     }
 
     public void serviceAvailable(BeanContextServiceAvailableEvent bcsae) {
@@ -158,22 +162,23 @@
        
         
 
+        
         // 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) {
-
+        if (!(this.rejectedSetBCOnce && this.lastVetoedContext == bc)) {
+            this.lastVetoedContext = bc;
             this.rejectedSetBCOnce = true;
             // Validate the new BeanContext value and throw
             // PropertyVetoException if it was not successful
-            if (!validatePendingSetBeanContext(bc)) {
-                
-
+            if (!validatePendingSetBeanContext(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();
@@ -183,7 +188,7 @@
             firePropertyChange(BEAN_CONTEXT, this.beanContext, bc);
             this.beanContext = bc;
             initializeBeanContextResources();
-        }
+        //}
     }
 
     public boolean validatePendingSetBeanContext(BeanContext newValue) {



Mime
View raw message