Skip to content

Conversation

@TejeshR13
Copy link
Contributor

@TejeshR13 TejeshR13 commented Jan 16, 2023

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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8300084: AquaFileChooserUI.getDefaultButton returns null

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12008/head:pull/12008
$ git checkout pull/12008

Update a local copy of the PR:
$ git checkout pull/12008
$ git pull https://git.openjdk.org/jdk pull/12008/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12008

View PR using the GUI difftool:
$ git pr show -t 12008

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12008.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 16, 2023

👋 Welcome back tr! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 16, 2023
@openjdk
Copy link

openjdk bot commented Jan 16, 2023

@TejeshR13 The following label will be automatically applied to this pull request:

  • client

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.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Jan 16, 2023
@mlbridge
Copy link

mlbridge bot commented Jan 16, 2023

Webrevs

Copy link
Member

@aivanov-jdk aivanov-jdk left a 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.

Comment on lines 44 to 48
JFileChooser fileChooser = new JFileChooser();
JButton defaultApproveButton = fileChooser.getUI().getDefaultButton(fileChooser);
if (defaultApproveButton == null) {
throw new RuntimeException("getDefaultButton() method returns null for Aqua L&F!");
}
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@openjdk
Copy link

openjdk bot commented Jan 16, 2023

@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:

8300084: AquaFileChooserUI.getDefaultButton returns null

Reviewed-by: aivanov, serb

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 master branch:

  • 506c818: 8296401: ConcurrentHashTable::bulk_delete might miss to delete some objects
  • 319de6a: 8300124: Remove unnecessary assert in GenCollectedHeap::initialize
  • 289aed4: 8298128: runtime/ErrorHandling/TestSigInfoInHsErrFile.java fails to find pattern with slowdebug
  • a2f6766: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines
  • a734285: 8299879: CollectedHeap hierarchy should use override
  • 98d75f1: 8299038: Add AArch64 backend support for auto-vectorized FP16 conversions
  • cac72a6: 8300053: Shenandoah: Handle more GCCauses in ShenandoahControlThread::request_gc
  • 6fea233: 8299960: Speed up test/hotspot/jtreg/compiler/c2/irTests/TestVectorizeURShiftSubword.java
  • 7c1ebcc: 8299962: Speed up compiler/intrinsics/unsafe/DirectByteBufferTest.java and HeapByteBufferTest.java
  • abfd7e8: 8300113: C2: Single-bit fields with signed type in TypePtr after JDK-8297933
  • ... and 218 more: https://git.openjdk.org/jdk/compare/a3693ccc617d06137a61050b34646e8a90ed3d7e...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 16, 2023
@TejeshR13
Copy link
Contributor Author

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.

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.

@aivanov-jdk
Copy link
Member

aivanov-jdk commented Jan 16, 2023

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.

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 getDefaultButton returns null, isn't it? This fix makes it return non-null, therefore Aqua L&F can be included in testing.

This fix should be integrated before JDK-8299522. I will not approve #11901 until Aqua L&F is part of the CustomApproveButtonTest.java test.

@TejeshR13
Copy link
Contributor Author

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.

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 getDefaultButton returns null, isn't it? This fix makes it return non-null, therefore Aqua L&F can be included in testing.

This fix should be integrated before JDK-8299522. I will not approve #11901 until Aqua L&F is part of the CustomApproveButtonTest.java test.
The Aqua L&F is excluded not only because getDefaultButton returns null, but it is also excluded because the fix doesn't apply to Aqua L&F. Still if u insist to use the same test then can do that, as u said first this fix will go in and then #11901.

Comment on lines 45 to 46
JButton defApproveBtn = fc.getUI().getDefaultButton(fc);
if (defApproveBtn == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor Author

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.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jan 16, 2023
@aivanov-jdk
Copy link
Member

It's exactly the point: include Aqua L&F in #11901. The Aqua L&F is excluded only because getDefaultButton returns null, isn't it? This fix makes it return non-null, therefore Aqua L&F can be included in testing.

This fix should be integrated before JDK-8299522. I will not approve #11901 until Aqua L&F is part of the CustomApproveButtonTest.java test.

The Aqua L&F is excluded not only because getDefaultButton returns null, but it is also excluded because the fix doesn't apply to Aqua L&F. Still if u insist to use the same test then can do that, as u said first this fix will go in and then #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.

TejeshR13 added a commit to TejeshR13/jdk that referenced this pull request Jan 16, 2023
Copy link
Member

@aivanov-jdk aivanov-jdk left a 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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 16, 2023
@TejeshR13
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 17, 2023

Going to push as commit 8365c67.
Since your change was applied there have been 235 commits pushed to the master branch:

  • 382fe51: 8163229: several regression tests have a main method that is never executed
  • 06f9374: 8298867: Basics.java fails with SSL handshake exception
  • 859ccd1: 8299847: RISC-V: Improve PrintOptoAssembly output of CMoveI/L nodes
  • 240830d: 8297092: [macos_aarch64] Add support for SHA feature detection
  • f52f6e6: 8299972: Remove metaprogramming/removeReference.hpp
  • 4c1e66e: 8299971: Remove metaprogramming/conditional.hpp
  • 4073b68: 8298047: Remove all non-significant trailing whitespace from properties files
  • 506c818: 8296401: ConcurrentHashTable::bulk_delete might miss to delete some objects
  • 319de6a: 8300124: Remove unnecessary assert in GenCollectedHeap::initialize
  • 289aed4: 8298128: runtime/ErrorHandling/TestSigInfoInHsErrFile.java fails to find pattern with slowdebug
  • ... and 225 more: https://git.openjdk.org/jdk/compare/a3693ccc617d06137a61050b34646e8a90ed3d7e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 17, 2023
@openjdk openjdk bot closed this Jan 17, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 17, 2023
@openjdk
Copy link

openjdk bot commented Jan 17, 2023

@TejeshR13 Pushed as commit 8365c67.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants