harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HARMONY-4011) [classlib][beans] compatibility: java.beans.beancontext.BeanContextSupport allows registering the same listener several times
Date Wed, 20 Jun 2007 08:14:26 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexei Zakharov reassigned HARMONY-4011:
----------------------------------------

    Assignee: Alexei Zakharov

> [classlib][beans] compatibility: java.beans.beancontext.BeanContextSupport allows registering
the same listener several times
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4011
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4011
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Roman S. Bushmanov
>            Assignee: Alexei Zakharov
>         Attachments: H-4011.patch
>
>
> Successive calls to addBeanContextMembershipListener() method with the same object as
argument result in adding that object into listener set multiple times. RI behaves differently.
> The exact behaviour in the described case is not specified, but it makes sense to be
compatible with RI. 
> To reproduce the issue, please run the test listed below.
> -------------------------- Expected output (= RI output): -----------------------
> Listener added
> ADDED
> Listener added again
> ADDED
> ---------------------------------- Harmony output ----------------------------------
> Listener added
> ADDED
> Listener added again
> ADDED
> ADDED
> ---------------------------------------  Test.java  --------------------------------------

> import java.beans.beancontext.*;
> public class Test{
>     public static void main(String[] args){
>         BeanContextSupport context = new BeanContextSupport();
>         BeanContextMembershipListener listener = new BeanContextMembershipListener()
{
>             public void childrenAdded(BeanContextMembershipEvent bcme) {
>                 System.out.println("ADDED");
>             }
>             public void childrenRemoved(BeanContextMembershipEvent bcme){}
>         };
>         // add listener
>         context.addBeanContextMembershipListener(listener);
>         System.out.println("Listener added");
>         context.add(new BeanContextChildSupport());
>         
>         // add the same listener onse again
>         System.out.println("Listener added again");
>         context.addBeanContextMembershipListener(listener);
>         context.add(new BeanContextChildSupport());
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message