Skip to content
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

8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim() #3136

Closed

Conversation

azvegint
Copy link
Member

@azvegint azvegint commented Mar 22, 2021

Looks like the original idea was to set fallbacktext on strings containing only spaces.

I decided to remove the trim() call to keep the same behavior and to allows to set such meaningless space only titles/tooltips(same as on other platforms, maybe someone want empty label for some reason).


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim()

Reviewers

Download

To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3136/head:pull/3136
$ git checkout pull/3136

To update a local copy of the PR:
$ git checkout pull/3136
$ git pull https://git.openjdk.java.net/jdk pull/3136/head

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 22, 2021

👋 Welcome back azvegint! 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 Mar 22, 2021
@openjdk
Copy link

openjdk bot commented Mar 22, 2021

@azvegint The following labels will be automatically applied to this pull request:

  • 2d
  • awt
  • swing

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added 2d client-libs-dev@openjdk.org swing client-libs-dev@openjdk.org awt client-libs-dev@openjdk.org labels Mar 22, 2021
@azvegint
Copy link
Member Author

/label remove 2d awt

@openjdk openjdk bot removed 2d client-libs-dev@openjdk.org awt client-libs-dev@openjdk.org labels Mar 22, 2021
@openjdk
Copy link

openjdk bot commented Mar 22, 2021

@azvegint
The 2d label was successfully removed.

The awt label was successfully removed.

@mlbridge
Copy link

mlbridge bot commented Mar 22, 2021

Webrevs

@openjdk
Copy link

openjdk bot commented Mar 22, 2021

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

8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim()

Reviewed-by: serb, pbansal, kizune, trebari, psadhukhan

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 59 new commits pushed to the master branch:

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 Mar 22, 2021
@@ -2057,7 +2056,6 @@ String getApproveButtonToolTipText(final JFileChooser fc) {
String getApproveButtonToolTipText(final JFileChooser fc, final String fallbackText) {
final String tooltipText = fc.getApproveButtonToolTipText();
if (tooltipText != null) {
tooltipText.trim();
if (!tooltipText.isEmpty()) return tooltipText;
Copy link
Contributor

Choose a reason for hiding this comment

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

In other L&F like Metal, Basic even empty text is allowed.. there's no check for isEmpty()....Should we do the same here too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I think it would be better to allow to set empty text to conform with other LaF behavior.

Also JFileChooser.getApproveButtonText() and JFileChooser.getApproveButtonToolTipText() will now return correct values for empty strings.
e.g. before the fix if we call setApproveButtonText("") subsequent call to getApproveButtonText() will return passed string, but in fact fallback string is used.

I've also labeled the issue with noreg-hard.

Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to set an empty label in the native file chooser on macOS?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, and it looks the same as the one with " " label.
image

@azvegint
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Mar 25, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 25, 2021
@openjdk
Copy link

openjdk bot commented Mar 25, 2021

@azvegint Since your change was applied there have been 75 commits pushed to the master branch:

  • a1e717f: 8264146: Make Mutex point to rather than embed _name
  • f69afba: 8263300: add HtmlId for the block containing a class's description.
  • d82464f: 8263528: Make static page ids safe from collision with language elements
  • d602ae0: 8263884: Clean up os::is_allocatable() across Posix platforms
  • a9d287a: 8260388: Listing (sub)packages at package level of API documentation
  • 8120064: 8263781: C2: Cannot hoist independent load above arraycopy
  • 9689863: 8262295: C2: Out-of-Bounds Array Load from Clone Source
  • a678a38: 8263743: redundant lock in SSLSocketImpl
  • 3fcb499: 8263768: JFormattedTextField.AbstractFormatter.getDocumentFilter()/getNavigationFilter() spec doesn't mention what the default impls return and what does it mean
  • 4155533: 8258753: StartTlsResponse.close() hangs due to synchronization issues
  • ... and 65 more: https://git.openjdk.java.net/jdk/compare/f62b1008ed136dcbe7ee17191cc9b77ca2b70334...master

Your commit was automatically rebased without conflicts.

Pushed as commit c037e1e.

💡 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
integrated Pull request has been integrated swing client-libs-dev@openjdk.org
6 participants