I have posted about this before, but it keeps coming back to bite me,
or ...  not me, but people on my projects. It needs to be addressed...
This issue is widespread in GWT, and also in many other frameworks.

Imagine ClickListener in Button/ButtonBase/ClickListenerCollection, is
an ArrayList. IF, while during dispatch, a component removes, or adds
a ClickListener to the ArrayList of Listeners... The Iterator
generally used will malfunction: depending on the order of
registration, or the order of execution, one listener will be skipped
( in the case of remove, as the list is "slidded" down"  or missed, as
the list is expanded to add a new Listener, it will fire... ). The
only SANE conclusion I can imagine is to CLONE or copy the listener
list at dispatch:

public Iterator<L> iterator()
        {
                ArrayList<L> temp = new ArrayList<L>(this.m_listeners);

                return temp.iterator();
        }

one line of code would fix this problem. It may seem like an edge
case, but it comes up more than I would imagine.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to