Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8263454: com.apple.laf.AquaFileChooserUI ignores the result of String…
….trim()

Reviewed-by: serb, pbansal, kizune, trebari, psadhukhan
  • Loading branch information
Alexander Zvegintsev committed Mar 25, 2021
1 parent a1e717f commit c037e1e
Showing 1 changed file with 7 additions and 11 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -2037,11 +2037,9 @@ String getApproveButtonText(final JFileChooser fc) {
// Try to get the custom text. If none, use the fallback
String getApproveButtonText(final JFileChooser fc, final String fallbackText) {
final String buttonText = fc.getApproveButtonText();
if (buttonText != null) {
buttonText.trim();
if (!buttonText.isEmpty()) return buttonText;
}
return fallbackText;
return buttonText != null
? buttonText
: fallbackText;
}

int getApproveButtonMnemonic(final JFileChooser fc) {
Expand All @@ -2056,11 +2054,9 @@ 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;
}
return fallbackText;
return tooltipText != null
? tooltipText
: fallbackText;
}

String getCancelButtonToolTipText(final JFileChooser fc) {
Expand Down

1 comment on commit c037e1e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.