RFR: 8300084: AquaFileChooserUI.getDefaultButton returns null [v2]
Alexey Ivanov
aivanov at openjdk.org
Mon Jan 16 13:49:25 UTC 2023
On Mon, 16 Jan 2023 13:04:27 GMT, Tejesh R <tr at openjdk.org> 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
More information about the client-libs-dev
mailing list