Community
Participate
Working Groups
i'm having a hard time finding a single instance of ListenerList class (i'm running under a profiler) in which the list would contain more than 1 element so the other 2 are almost always wasted because this class is instantiated many, many times (i just started and see more than 1300 instances) the default size should be 1. It can then grow if necessary. (This class should really live in core - because it does not, everybody copied it. So more reports will be needed)
see bug 27110 - for the JDT ui copy of that class
Added trace statements to add, remove and clear, showing the size. Had a resource perspective open, opened a Java perspective, and opened several preference pages. The majority of the listener lists had 1 listener. Of about 1000 listeners, the histogram of sizes (size -> number of listeners with that max size) is: 0: 8 1: ~950 (the rest) 2: 25 3: 4 4: 1 5: 5 Also saw counts of 12, 18, 26, 27, 28, 46, 56, 39, 87, and 102. Changing the default capacity to 1. It still grows the same way (2*N+1 each time), so this only adds one growth step for the other cases.
Released.
entered bug 27938 for the wrong home of this class