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

Alexander Zvegintsev azvegint at openjdk.java.net
Tue Mar 23 15:36:43 UTC 2021


On Tue, 23 Mar 2021 05:00:45 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   allow empty text
>
> 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?

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

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

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


More information about the swing-dev mailing list