Skip to content
Permalink
Browse files
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 c037e1edaf7f628b3e6a0b57a1029e0cdd134dc8
Showing with 7 additions and 11 deletions.
  1. +7 −11 src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java
@@ -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
@@ -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) {
@@ -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) {

1 comment on commit c037e1e

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on c037e1e Mar 25, 2021

Please sign in to comment.