On Mon, 16 Jan 2023 13:04:27 GMT, Tejesh R <[email protected]> wrote:

>> In Aqua look and feel, `getDefaultButton()` of `JFileChooser` returns null. 
>> The fix overrides the method from `FileChooserUI` to return the 
>> `ApproveButton` of `FileChooser` which is similar to other L&F. 
>> The test is run for multiple iterations in CI machine.
>
> Tejesh R has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Updated based on review comments

Changes requested by aivanov (Reviewer).

test/jdk/javax/swing/JFileChooser/AquaDefaultButtonTest.java line 46:

> 44:                 JFileChooser fc = new JFileChooser();
> 45:                 JButton defApproveBtn = fc.getUI().getDefaultButton(fc);
> 46:                 if (defApproveBtn == null) {

Suggestion:

                JButton approve = fc.getUI().getDefaultButton(fc);
                if (approve == null) {

On the scope of two lines, its type — `JButton` — as well as method name makes 
it obvious it's a _button_.

`approveButton` would also be good.

Yet I am for removing this test completely because it's functionality is 
entirely covered by the `CustomApproveButtonTest.java` in #11901.

-------------

PR: https://git.openjdk.org/jdk/pull/12008

Reply via email to