-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8300084: AquaFileChooserUI.getDefaultButton returns null #12008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back tr! A progress list of the required criteria for merging this PR into |
|
@TejeshR13 The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
aivanov-jdk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I doubt a separate test for this issue is worth it. This case is entirely covered by the test in #11901 for JDK-8299522, which also ensures the button text isn't empty.
Adding 8300084 to the @bug tag in that test is enough. It was my original suggestion:
Now you can fix this bug so that Aqua L&F doesn't return null and add that bugid to this test.
| JFileChooser fileChooser = new JFileChooser(); | ||
| JButton defaultApproveButton = fileChooser.getUI().getDefaultButton(fileChooser); | ||
| if (defaultApproveButton == null) { | ||
| throw new RuntimeException("getDefaultButton() method returns null for Aqua L&F!"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you choose shorter names for variables, the line would fit into 80-column limit. Now the two lines are nearly 100 characters long, though not a big issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please the copyright year in AquaFileChooserUI.java?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
|
@TejeshR13 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 228 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Yeah, but since #11901 handles only Approve button size except for Aqua L&F and this fix is only for Aqua L&F I thought it would be better to not to maintain any dependency between the test/bug (Though this bug was initiated as part of #11901 fix). I hope maintaining simple test case for two bug would be fine. |
It's exactly the point: include Aqua L&F in #11901. The Aqua L&F is excluded only because This fix should be integrated before JDK-8299522. I will not approve #11901 until Aqua L&F is part of the |
|
| JButton defApproveBtn = fc.getUI().getDefaultButton(fc); | ||
| if (defApproveBtn == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| JButton defApproveBtn = fc.getUI().getDefaultButton(fc); | |
| if (defApproveBtn == null) { | |
| 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then I'll remove this test and update #11901.
I do insist. The fix does not apply to Aqua L&F only because this situation has already be taken care of in Aqua L&F. Now all L&Fs are expected to return non-null text for the Approve button, I see no reason why Aqua L&F is skipped in testing: it is still expected that the Approve button in Aqua L&F is not null. |
aivanov-jdk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
|
/integrate |
|
Going to push as commit 8365c67.
Your commit was automatically rebased without conflicts. |
|
@TejeshR13 Pushed as commit 8365c67. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
In Aqua look and feel,
getDefaultButton()ofJFileChooserreturns null. The fix overrides the method fromFileChooserUIto return theApproveButtonofFileChooserwhich is similar to other L&F.The test is run for multiple iterations in CI machine.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12008/head:pull/12008$ git checkout pull/12008Update a local copy of the PR:
$ git checkout pull/12008$ git pull https://git.openjdk.org/jdk pull/12008/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12008View PR using the GUI difftool:
$ git pr show -t 12008Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12008.diff