src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java

Print this page

        

@@ -78,10 +78,11 @@
      *
      * Checks if the component:
      * 1) accepts focus on click (in general)
      * 2) may be a focus owner (in particular)
      */
+    @SuppressWarnings("deprecation")
     public static boolean shouldFocusOnClick(Component component) {
         boolean acceptFocusOnClick = false;
 
         // A component is generally allowed to accept focus on click
         // if its peer is focusable. There're some exceptions though.

@@ -108,20 +109,21 @@
     }
 
     /*
      * Posts proper lost/gain focus events to the event queue.
      */
+    @SuppressWarnings("deprecation")
     public static boolean deliverFocus(Component lightweightChild,
                                        Component target,
                                        boolean temporary,
                                        boolean focusedWindowChangeAllowed,
                                        long time,
                                        CausedFocusEvent.Cause cause,
                                        Component currentFocusOwner) // provided by the descendant peers
     {
         if (lightweightChild == null) {
-            lightweightChild = (Component)target;
+            lightweightChild = target;
         }
 
         Component currentOwner = currentFocusOwner;
         if (currentOwner != null && currentOwner.getPeer() == null) {
             currentOwner = null;