src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -794,11 +794,10 @@
      *
      * @param e the KeyEvent to be dispatched
      * @return <code>true</code>
      * @see Component#dispatchEvent
      */
-    @SuppressWarnings("deprecation")
     public boolean dispatchKeyEvent(KeyEvent e) {
         Component focusOwner = (((AWTEvent)e).isPosted) ? getFocusOwner() : e.getComponent();
 
         if (focusOwner != null && focusOwner.isShowing() && focusOwner.canBeFocusOwner()) {
             if (!e.isConsumed()) {

@@ -822,18 +821,18 @@
             postProcessKeyEvent(e);
         }
 
         // Allow the peer to process KeyEvent
         Component source = e.getComponent();
-        ComponentPeer peer = source.getPeer();
+        ComponentPeer peer = source.peer;
 
         if (peer == null || peer instanceof LightweightPeer) {
             // if focus owner is lightweight then its native container
             // processes event
             Container target = source.getNativeContainer();
             if (target != null) {
-                peer = target.getPeer();
+                peer = target.peer;
             }
         }
         if (peer != null) {
             peer.handleEvent(e);
         }

@@ -1047,11 +1046,11 @@
          */
         if (KeyboardFocusManager.isProxyActive(ke)) {
             Component source = (Component)ke.getSource();
             Container target = source.getNativeContainer();
             if (target != null) {
-                ComponentPeer peer = target.getPeer();
+                ComponentPeer peer = target.peer;
                 if (peer != null) {
                     peer.handleEvent(ke);
                     /**
                      * Fix for 4478780 - consume event after it was dispatched by peer.
                      */