Details
-
Type:
Improvement
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6
-
Fix Version/s: 1.7
-
Component/s: o.c.common.util
-
Labels:None
Description
The o.c.c.util.EventListenerList is far more complicated than is needed. It allows for more than one type of listener to be in the list.
CopyOnWriteArrayList provides the same of MT safety and removes the unneeded complexity.
The added benefit is that external synchronization on the list can be removed. It probably didn't need to be there in the first place.
Presumably these are event listeners are added by the user of the library? as opposed to JSword internally using them? Obviously, we only want to do this if it's rarely used - as copying a list of stuff many times would result in un-necessary memory allocations if it were use many times during an operation.
Otherwise, all up for reducing complexity. I'd personally favour waiting for Java 6 and use http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html
What do you think?