Construction performance of user created AWT components has become very slow. 100 times slower than creating a bootstrap component. It appears as part of a fix for Bug #4952802 that for every user component constructed, java.awt.Component checks to see is coalesceEvents is overriden. That is for every instance, not class. This procedure is expensive, particularly as failure to find the method causes an event to be created.
In addition to performance, there are also inadequacies in the logic applied:
o Superclasses are not checked if they override the method. By the looks of the use of equals, Class.getMethod was used instead of getDeclaredMethod in an earlier version, before realising getMethod does not catch protected methods. getDeclaredMethod does not catch methods in superclasses. I believe this change also contributes most of the performance hit.
o Any class under com.sun., sun. or javax. is assumed not to override the method.
o A finaliser is added to Component. Subclasses that also override finalize may not call their super (see Effective Java). Peculiarly the guard idiom is used for the key, which does prevent class loader leakage. Only causes two small objects leaked per affected component, plus finalisation overhead.
###@###.### 2005-07-19 17:26:31 GMT