changeset 10134:4ac8cec7ff40

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 c35d0a40b6e1
children e86678f580ae
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	Mon May 26 15:50:10 2014 +0400
+++ b/src/share/classes/javax/swing/JComponent.java	Mon May 26 16:37:25 2014 +0400
@@ -3679,8 +3679,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;
@@ -3738,14 +3738,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);
@@ -3760,7 +3756,6 @@
          */
         public void removePropertyChangeListener(PropertyChangeListener listener) {
             if (--propertyListenersCount == 0) {
-                JComponent.this.removeFocusListener(accessibleFocusHandler);
                 JComponent.this.removeContainerListener(accessibleContainerHandler);
             }
             super.removePropertyChangeListener(listener);