harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry A. Durnev (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-320) PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener) doesn't remove a specific property listener
Date Thu, 04 May 2006 08:03:17 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-320?page=comments#action_12377737 ] 

Dmitry A. Durnev commented on HARMONY-320:
------------------------------------------

The problem is resolved: test output on Harmony is the same as on RI.
Verified against rev. 399587(linux), 399591(Windows).

> PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener) doesn't remove
a specific property listener
> ----------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-320
>          URL: http://issues.apache.org/jira/browse/HARMONY-320
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: j9 + Harmony classlib
>     Reporter: Dmitry A. Durnev
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: patch320.diff
>
> If the listener was added with addPropertyChangeListener(String, 
> PropertyChangeListener) it is not removed by  removePropertyChangeListener
> (PropertyChangeListener). See test below. RI output is:
> 1
> 0
> Harmony output is:
> 1
> 1
> Test:
> --------------------------------------------------------------------------------------------
> import java.beans.*;
> public class PropertyChangeSupportTest {
>    PropertyChangeSupport pcs = new PropertyChangeSupport(this);
>    PropertyChangeListener listener = new PropertyChangeListener() {
>     public void propertyChange(PropertyChangeEvent arg0) {        
>     }
>        
>    };
>     public static void main(String[] args) {
>         new PropertyChangeSupportTest().runTest();
>     }
>     
>     void runTest() {
>         pcs.addPropertyChangeListener("property", listener);
>         PropertyChangeListener[] listeners = pcs.getPropertyChangeListeners(); 
>         System.out.println(listeners.length);
>         pcs.removePropertyChangeListener(listeners[0]);
>         listeners = pcs.getPropertyChangeListeners();
>         System.out.println(pcs.getPropertyChangeListeners().length);
>     }
> }

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