On Fri, 3 Feb 2023 11:33:57 GMT, Abhishek Kumar <[email protected]> wrote:
>> Damon Nguyen has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Simplify Nimbus LAF check
>
> test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTest.java line 2:
>
>> 1: /*
>> 2: * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
>
> Copyright year can be changed to 2023.
Updated
> test/jdk/javax/swing/JComboBox/DisabledComboBoxFontTest.java line 118:
>
>> 116: hasNimbus = false;
>> 117:
>> 118: for (LookAndFeelInfo info :
>> UIManager.getInstalledLookAndFeels()) {
>
> It seems the intention to run the test is in Nimbus LAF only. I think you can
> directly set the Nimbus LAF using
> `UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");` and
> can avoid the `for-loop, condition check` and `hasNimbus `variable.
>
> To print the error message, LAF can be set within try-catch block.
Thanks for the suggestion. I made the change. I initially had this loop to test
locally for all LAF's, but ended up using this test for Nimbus only as
originally designed.
-------------
PR: https://git.openjdk.org/jdk/pull/12390