On Fri, 28 Jun 2024 19:54:37 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> Abhishek Kumar has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove AquaMnemonicHandler class and unused APIs from WinDowsLookAndFeel, >> copyright year update > > test/jdk/com/sun/java/swing/plaf/gtk/TestMenuMnemonicOnAltPress.java line 63: > >> 61: >> UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); >> 62: } else if (laf.getName().contains("Aqua")) { >> 63: >> UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); > > Suggestion: > > if (laf.getName().contains("GTK")) { > UIManager.setLookAndFeel(laf.getClassName()); > } else if (laf.getName().contains("Aqua")) { > UIManager.setLookAndFeel(laf.getClassName()); > > Now that the body of both `if` statements is the same, you can combine the > conditions into one `if` statement. Alternatively, you can choose the look-and-feel before starting the test: there's always only one available. If you found a L&F, install it and run the test outside the loop (over `LookAndFeelInfo` array). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18992#discussion_r1659262410