Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 66155 invoked from network); 21 Sep 2006 07:57:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Sep 2006 07:57:04 -0000 Received: (qmail 3236 invoked by uid 500); 21 Sep 2006 07:57:04 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 3131 invoked by uid 500); 21 Sep 2006 07:57:04 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 3120 invoked by uid 99); 21 Sep 2006 07:57:04 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Sep 2006 00:57:04 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:50778] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 7B/A2-04092-FC542154 for ; Thu, 21 Sep 2006 00:57:03 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 219617142C9 for ; Thu, 21 Sep 2006 07:53:25 +0000 (GMT) Message-ID: <2903620.1158825205134.JavaMail.jira@brutus> Date: Thu, 21 Sep 2006 00:53:25 -0700 (PDT) From: "Paulex Yang (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Updated: (HARMONY-420) [classlib][beans]improper listener notification in java.beans.VetoableChangeSupport In-Reply-To: <18769375.1146215618751.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-420?page=all ] Paulex Yang updated HARMONY-420: -------------------------------- Summary: [classlib][beans]improper listener notification in java.beans.VetoableChangeSupport (was: improper listener notification in java.beans.VetoableChangeSupport) Assignee: Paulex Yang > [classlib][beans]improper listener notification in java.beans.VetoableChangeSupport > ----------------------------------------------------------------------------------- > > Key: HARMONY-420 > URL: http://issues.apache.org/jira/browse/HARMONY-420 > Project: Harmony > Issue Type: Bug > Components: Classlib > Environment: Harmony Class Library, J9 > Reporter: Maxim Berkultsev > Assigned To: Paulex Yang > Priority: Minor > Attachments: diff > > > VetoableChangeSupport functionality is not covered completely > Following test code is under examination > ---------------------------------------------- > import java.beans.*; > public class VetoableChangeSupportTest { > > private VetoableChangeSupport support = new VetoableChangeSupport(this); > > private PropertyChangeEvent event; > > private String vetoedPropertyName = "property1"; > > private Integer basicOldValue = new Integer(1); > private Integer basicNewValue = new Integer(2); > > public static void main(String[] args) { > new VetoableChangeSupportTest().run(); > } > void run(){ > support.addVetoableChangeListener(new VetoableChangeListener() { > public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { > event = e; > String propertyName = e.getPropertyName(); > > Integer oldValue = (Integer) e.getOldValue(); > Integer newValue = (Integer) e.getNewValue(); > > System.out.println("in the first listener with property named = " > + propertyName > + " and old value = " > + oldValue > + " and new value = " > + newValue > ); > > > if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicNewValue)) { > System.out.println("in the first listener with property named = " > + propertyName > + " and old value = " > + oldValue > + " and new value = " > + newValue > + " exception is thrown" > ); > throw new PropertyVetoException(propertyName + " change is vetoed.", e); > } > } > }); > > support.addVetoableChangeListener(new VetoableChangeListener() { > public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { > event = e; > String propertyName = e.getPropertyName(); > > Integer oldValue = (Integer) e.getOldValue(); > Integer newValue = (Integer) e.getNewValue(); > > System.out.println("in the second listener with property named = " > + propertyName > + " and old value = " > + oldValue > + " and new value = " > + newValue > ); > > if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicOldValue)) { > System.out.println("in the second listener with property named = " > + propertyName > + " and old value = " > + oldValue > + " and new value = " > + newValue > + " exception is thrown" > ); > throw new PropertyVetoException(propertyName + " change is vetoed.", e); > } > } > }); > > try { > support.fireVetoableChange(vetoedPropertyName, basicNewValue, basicOldValue); > } catch(PropertyVetoException pve) { > System.out.println("PropertyVetoException is finally thrown."); > } > } > > } > ---------------------------------------------- > For j9 + ClassLib the output of the test is > in the first listener with property named = property1 and old value = 2 and new value = 1 > in the second listener with property named = property1 and old value = 2 and new value = 1 > in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown > in the first listener with property named = property1 and old value = 1 and new value = 2 > in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown > PropertyVetoException is finally thrown. > For RI > in the first listener with property named = property1 and old value = 2 and new value = 1 > in the second listener with property named = property1 and old value = 2 and new value = 1 > in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown > in the first listener with property named = property1 and old value = 1 and new value = 2 > in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown > in the second listener with property named = property1 and old value = 1 and new value = 2 > PropertyVetoException is finally thrown. > Looks like the second listener is not notified after the PropertyVetoException is thrown for the second time -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira