changeset 9630:91975f822db8

8009883: REGRESSION: test/closed/javax/swing/AbstractButton/4246045/bug4246045.java fails Summary: remove redundant focus handler that was causing a second focus event Reviewed-by: alexsch, pchelko Contributed-by: peter.brunet@oracle.com
author serb
date Mon, 26 May 2014 16:37:25 +0400
parents fe7704d1b87b
children f218d0fa2130
files src/share/classes/javax/swing/JComponent.java
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/JComponent.java	Fri May 30 14:54:57 2014 +0100
+++ b/src/share/classes/javax/swing/JComponent.java	Mon May 26 16:37:25 2014 +0400
@@ -3676,8 +3676,8 @@
         private volatile transient int propertyListenersCount = 0;
 
         /**
-         * This field duplicates the one in java.awt.Component.AccessibleAWTComponent,
-         * so it has been deprecated.
+         * This field duplicates the function of the accessibleAWTFocusHandler field
+         * in java.awt.Component.AccessibleAWTComponent, so it has been deprecated.
          */
         @Deprecated
         protected FocusListener accessibleFocusHandler = null;
@@ -3735,14 +3735,10 @@
          * @param listener  the PropertyChangeListener to be added
          */
         public void addPropertyChangeListener(PropertyChangeListener listener) {
-            if (accessibleFocusHandler == null) {
-                accessibleFocusHandler = new AccessibleFocusHandler();
-            }
             if (accessibleContainerHandler == null) {
                 accessibleContainerHandler = new AccessibleContainerHandler();
             }
             if (propertyListenersCount++ == 0) {
-                JComponent.this.addFocusListener(accessibleFocusHandler);
                 JComponent.this.addContainerListener(accessibleContainerHandler);
             }
             super.addPropertyChangeListener(listener);
@@ -3757,7 +3753,6 @@
          */
         public void removePropertyChangeListener(PropertyChangeListener listener) {
             if (--propertyListenersCount == 0) {
-                JComponent.this.removeFocusListener(accessibleFocusHandler);
                 JComponent.this.removeContainerListener(accessibleContainerHandler);
             }
             super.removePropertyChangeListener(listener);