jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java
changeset 40719 4ae72a69bd3b
parent 37694 c064aefc5a2f
child 43722 25ba19c20260
--- a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java	Tue Aug 23 20:45:35 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java	Wed Aug 24 00:23:49 2016 +0400
@@ -40,8 +40,6 @@
 
 import java.lang.ref.WeakReference;
 
-import java.lang.reflect.Field;
-
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
@@ -140,6 +138,10 @@
                 public void removeLastFocusRequest(Component heavyweight) {
                     KeyboardFocusManager.removeLastFocusRequest(heavyweight);
                 }
+                @Override
+                public Component getMostRecentFocusOwner(Window window) {
+                    return KeyboardFocusManager.getMostRecentFocusOwner(window);
+                }
                 public void setMostRecentFocusOwner(Window window, Component component) {
                     KeyboardFocusManager.setMostRecentFocusOwner(window, component);
                 }
@@ -3053,32 +3055,9 @@
         }
     }
 
-    static Field proxyActive;
     // Accessor to private field isProxyActive of KeyEvent
     private static boolean isProxyActiveImpl(KeyEvent e) {
-        if (proxyActive == null) {
-            proxyActive =  AccessController.doPrivileged(new PrivilegedAction<Field>() {
-                    public Field run() {
-                        Field field = null;
-                        try {
-                            field = KeyEvent.class.getDeclaredField("isProxyActive");
-                            if (field != null) {
-                                field.setAccessible(true);
-                            }
-                        } catch (NoSuchFieldException nsf) {
-                            assert(false);
-                        }
-                        return field;
-                    }
-                });
-        }
-
-        try {
-            return proxyActive.getBoolean(e);
-        } catch (IllegalAccessException iae) {
-            assert(false);
-        }
-        return false;
+        return AWTAccessor.getKeyEventAccessor().isProxyActive(e);
     }
 
     // Returns the value of this KeyEvent's field isProxyActive