On 11/14/2012 7:30 PM, Pete Brunet wrote:
Could someone from the Swing team please review this?
The fix looks good for me.
Thanks,
Alexandr.
-------- Original Message --------
Subject: Please review fix for 7177111 :
Jcomponent.AccessibleJComponent.AddPropertyListeners adds exponential
listeners
Date: Thu, 08 Nov 2012 15:51:19 -0600
From: Pete Brunet <[email protected]>
Reply-To: [email protected]
To: awt-dev <[email protected]>, [email protected]
Hi Everyone, Please review the following fix planned for 7u12. It
will also go into 8 under 7179482.
Problem:
When an AT (Assistive Technology) accesses a Java application with
several nested frames, too many property change listeners are added
resulting in a severe performance impact for an AT user.
The issue is due to the fact that there is an
accessibleContainerHandler field in both
javax.swing.JComponent.AccessibleJComponent and its superclass,
java.awt.Container.AccessibleAWTContainer. When an AT calls
JComponent.AccessibleJComponent.addPropertyChangeListener a handler is
new'd and assigned to its accessibleContainerHandler field and then
the same method in the superclass is called and it also new's and
assigns a handler to its accessibleContainerHandler field. Since
there are two handlers, when a child component is later added there
are two callbacks and for each one the AT will call
addPropertyChangeListener, each of which will add two handlers. For
deeply nested trees the explosion of events has a negative impact on
performance, i.e. there are 2 handlers added for the first level, 4
for the second level, 8 for the third level, etc.
Solution:
Remove protected field
javax.swing.JComponent.AccessibleJComponent.accessibleContainerHandler.
Instead, the protected field of the same name in
java.awt.Container.AWTAccessibleContainer will be used.
Webrev: http://cr.openjdk.java.net/~ptbrunet/7177111/webrev.03/
Bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7177111
http://monaco.us.oracle.com/detail.jsf?cr=7177111
CCC: http://ccc.us.oracle.com/7177111