--- old/src/java.desktop/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java 2015-09-18 18:47:29.018071900 +0300 +++ new/src/java.desktop/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java 2015-09-18 18:47:28.539071900 +0300 @@ -42,8 +42,10 @@ private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl"); - private static AWTAccessor.KeyboardFocusManagerAccessor kfmAccessor = - AWTAccessor.getKeyboardFocusManagerAccessor(); + private static class KfmAccessor { + private static AWTAccessor.KeyboardFocusManagerAccessor instance = + AWTAccessor.getKeyboardFocusManagerAccessor(); + } // The constants are copied from java.awt.KeyboardFocusManager public static final int SNFH_FAILURE = 0; @@ -152,12 +154,13 @@ long time, CausedFocusEvent.Cause cause) { - return kfmAccessor.shouldNativelyFocusHeavyweight( - heavyweight, descendant, temporary, focusedWindowChangeAllowed, time, cause); + return KfmAccessor.instance.shouldNativelyFocusHeavyweight( + heavyweight, descendant, temporary, focusedWindowChangeAllowed, + time, cause); } public static void removeLastFocusRequest(Component heavyweight) { - kfmAccessor.removeLastFocusRequest(heavyweight); + KfmAccessor.instance.removeLastFocusRequest(heavyweight); } // WARNING: Don't call it on the Toolkit thread. @@ -167,7 +170,8 @@ boolean focusedWindowChangeAllowed, long time) { - return kfmAccessor.processSynchronousLightweightTransfer( - heavyweight, descendant, temporary, focusedWindowChangeAllowed, time); + return KfmAccessor.instance.processSynchronousLightweightTransfer( + heavyweight, descendant, temporary, focusedWindowChangeAllowed, + time); } } --- old/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java 2015-09-18 18:47:31.581071900 +0300 +++ new/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java 2015-09-18 18:47:31.103071900 +0300 @@ -325,23 +325,6 @@ }; /** - * The default strokes for initializing the default focus traversal keys. - */ - private static final AWTKeyStroke[][] defaultFocusTraversalKeyStrokes = { - { - AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0, false), - AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK, false), - }, - { - AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK, false), - AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, - InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK, - false), - }, - {}, - {}, - }; - /** * The default focus traversal keys. Each array of traversal keys will be * in effect on all Windows that have no such array of their own explicitly * set. Each array will also be inherited, recursively, by any child @@ -431,6 +414,27 @@ * Initializes a KeyboardFocusManager. */ public KeyboardFocusManager() { + AWTKeyStroke[][] defaultFocusTraversalKeyStrokes = { + { + AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0, false), + AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, + InputEvent.CTRL_DOWN_MASK | + InputEvent.CTRL_MASK, false), + }, + { + AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, + InputEvent.SHIFT_DOWN_MASK | + InputEvent.SHIFT_MASK, false), + AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, + InputEvent.SHIFT_DOWN_MASK | + InputEvent.SHIFT_MASK | + InputEvent.CTRL_DOWN_MASK | + InputEvent.CTRL_MASK, + false), + }, + {}, + {}, + }; for (int i = 0; i < TRAVERSAL_KEY_LENGTH; i++) { Set work_set = new HashSet<>(); for (int j = 0; j < defaultFocusTraversalKeyStrokes[i].length; j++) {