harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HARMONY-321) VetoableChangeSupport: the reverting event is not fired if the change is vetoed
Date Fri, 21 Apr 2006 03:41:06 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-321?page=all ]

Mikhail Loenko reassigned HARMONY-321:
--------------------------------------

    Assign To: Mikhail Loenko

> VetoableChangeSupport: the reverting event is not fired if the change is vetoed
> -------------------------------------------------------------------------------
>
>          Key: HARMONY-321
>          URL: http://issues.apache.org/jira/browse/HARMONY-321
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: j9 + Harmony classlib
>     Reporter: Dmitry A. Durnev
>     Assignee: Mikhail Loenko
>     Priority: Minor

>
> The spec on VetoableChangeSupport.fireVetoableChange(String, Object, Object)
> reads:
> "If anyone vetos the change, then fire a new event reverting everyone to the old 
> value and then rethrow the PropertyVetoException." 
> This "new event" is never fired. See test below. Expected and RI output is:
> 1
> 0
> But actual output on Harmony is:
> 0
> 1
> Test:
> ---------------------------------------------
> import java.beans.*;
> public class VetoableChangeSupportTest {
>     VetoableChangeSupport vcs = new VetoableChangeSupport(this);
>     PropertyChangeEvent event;
>     String vetoedPropName = "prop";
>     VetoableChangeListener vlistener = new VetoableChangeListener() {        
>         public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException
{
>             event = e;
>             String propName = e.getPropertyName();
>             if (propName.equals(vetoedPropName) && e.getNewValue().equals(new
Integer(1))) {                
>                 throw new PropertyVetoException(propName + " change is vetoed!", e);
>             }
>         }
>         
>     };
>     public static void main(String[] args) {
>         new VetoableChangeSupportTest().runTest();
>     }
>     
>     void runTest(){
>         vcs.addVetoableChangeListener(vlistener);
>         try {
>             vcs.fireVetoableChange(vetoedPropName, 0, 1);
>         }
>         catch (PropertyVetoException pve) {
>             
>         }
>         System.out.println(event.getOldValue());
>         System.out.println(event.getNewValue());
>     }
> }

-- 
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


Mime
View raw message