clone the list
well actually that sucks...
you gonna clone every time you send a notification?
add/remove listeners on a copy, and make that the current active list once you're done iterating the list of listeners.
That would be ok if sendNotification was synchronized. Otherwise the semantics seem a little vague... in fact even the
Iterator listenerIterator = new ArrayList(listenerMap.keySet()).iterator();
solution should be synchronized on listenerMap as should the add/remove listener methods.
(doesn't look like Set extends Cloneable).
Are you OK with all this synchronization? If not I will write something in my class. I don't want to write the add/remove modifies copy right now.
yea go ahead
either that or use OSWEGO, the iterators never throw CME (but you need to explicitly deal with null values)