Hi All,

Please review a fix for an issue where it is seen javax/swing/plaf/basic/BasicSplitPaneUI/Test6657026.java fails reporting "Shared traversal keys" for Nimbus LaF.

Bug: https://bugs.openjdk.java.net/browse/JDK-7190595
webrev: http://cr.openjdk.java.net/~psadhukhan/7190595/webrev.00/

Issue was "managingFocusForwardTraversalKeys" and "managingFocusBackwardTraversalKeys" is a static field in
http://hg.openjdk.java.net/jdk9/client/jdk/file/8270102790e5/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java#l51
so when JSplitPane is instantiated several times as in this particular testcase, managingFocusForwardTraversalKeys and managingFocusBackwardTraversalKeys is NOT null from 2nd time so no keyStroke is added to this Set

so Set is not null but empty.

Now, since keyStrokes is cleared in the testcase between 2 JSplitPane instantiation, next time getFocusTraversalKeys(0) is called, it returns an empty Set so the test fails.

Proposed fix is to remove the "static" keyword from this 2 Sets so that they gets instantiated each time JSplitPane is invoked. This problem is not present for other LaF like Metal because for those LaF, BasicSplitPaneUI is used instead of SynthSplitPaneUI (used only for Nimbus) where these fields are not static
[http://hg.openjdk.java.net/jdk9/client/jdk/file/8270102790e5/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java#l109]
which are removed as per JDK-6657026 [Numerous static security flaws in Swing(findbugs)]

Regards
Prasanta

Reply via email to