JDK-8069268 : JComponent.AccessibleJComponent.addPropertyListeners adds exponential listeners
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 8u25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-01-19
  • Updated: 2015-09-29
  • Resolved: 2015-02-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8u60 b06Fixed
Related Reports
Relates :  
Some code that was added to javax.swing.JComponent.java in jdk 1.6.0 was
inadvertently left out of jdk 1.8.0.

The code corrected a problem by which as new property listeners are added,
and exponential recursive list of propertyListeners are no longer added.

Comparing JComponent.java from jdk and jdk, the
following code is missing from the jdk 1.8.0 version:

diff command:
diff jdk7\JComponent.java jdk8\JComponent
<             if (accessibleFocusHandler == null) {
<                 accessibleFocusHandler = new AccessibleFocusHandler();
<                 JComponent.this.addFocusListener(accessibleFocusHandler);
<             }

This code should appear at the beginning of the addPropertyChangeListener

With this code missing, it renders JDeveloper unusable because of the exponential adding of propertyChangeListeners which eventually simply causes the jvm to stop working.
Crucible Review: https://java.se.oracle.com/code/cru/CR-JDK8UDEV-163

Fix for JDK-7177111 removed redundant accessibleContainerHandler (Already defined and added in parent class) definition which avoids same listener added twice problem. Fix for JDK-7179482 refactored the listener adding mechanism for Component/Container/JComponent's inner classes inherit from AccessibleContext, by using a private propertyListenersCount to make sure a listener is only added by addPropertyChangeListener once. In AccessibleJComponent, there is no class specific listener, a private propertyListenersCount member is used to add ContainerListener declared and added as property change listener in parent class: AccessibleAWTContainer, this way, the listener is added twice. http://ipw83120.uk.oracle.com:8080/source/xref/jdk8u-dev/jdk/src/share/classes/javax/swing/JComponent.java#3740 http://ipw83120.uk.oracle.com:8080/source/xref/jdk8u-dev/jdk/src/share/classes/java/awt/Container.java#3879