You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Loenko (JIRA)" <ji...@apache.org> on 2006/04/21 10:38:05 UTC

[jira] Assigned: (HARMONY-320) PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener) doesn't remove a specific property listener

     [ http://issues.apache.org/jira/browse/HARMONY-320?page=all ]

Mikhail Loenko reassigned HARMONY-320:
--------------------------------------

    Assign To: Mikhail Loenko

> 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

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