synchronized(listeners) { listeners.add(cl); }
CharacterEvent ce = new CharacterEvent(source, c); CharacterListener[] cl; synchronized(listeners) { cl = (CharacterListener[] ) listeners.toArray(new CharacterListener[0]); } for (int i = 0; i < cl.length; i++) cl[i].newCharacter(ce);
synchronized(listeners) { listeners.remove(cl); }