<Swing Dev> RFR: 8263454: com.apple.laf.AquaFileChooserUI ignores the result of String.trim()

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Tue Mar 23 05:03:41 UTC 2021


On Mon, 22 Mar 2021 22:19:18 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

> 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).

src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java line 2059:

> 2057:             final String tooltipText = fc.getApproveButtonToolTipText();
> 2058:             if (tooltipText != null) {
> 2059:                 if (!tooltipText.isEmpty()) return tooltipText;

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?

-------------

PR: https://git.openjdk.java.net/jdk/pull/3136


More information about the swing-dev mailing list