src/share/classes/java/awt/KeyboardFocusManager.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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

@@ -1907,11 +1907,11 @@
      * javax.swing.JComponent.runInputVerifier() using reflection.
      */
     static synchronized Component getMostRecentFocusOwner(Window window) {
         WeakReference<Component> weakValue =
             (WeakReference)mostRecentFocusOwners.get(window);
-        return weakValue == null ? null : (Component)weakValue.get();
+        return weakValue == null ? null : weakValue.get();
     }
 
     /**
      * This method is called by the AWT event dispatcher requesting that the
      * current KeyboardFocusManager dispatch the specified event on its behalf.

@@ -2494,13 +2494,13 @@
                     // acceptable value.
                     if (hwFocusRequest ==
                         HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER)
                     {
                         int size = heavyweightRequests.size();
-                        hwFocusRequest = (HeavyweightFocusRequest)((size >= 2)
+                        hwFocusRequest = (size >= 2)
                             ? heavyweightRequests.get(size - 2)
-                            : null);
+                            : null;
                     }
                     if (focusedWindowChanged(heavyweight,
                                              (hwFocusRequest != null)
                                              ? hwFocusRequest.heavyweight
                                              : nativeFocusedWindow)) {