RFR: 6753661: JFileChooser font not reset after Look & Feel change [v5]

Alexey Ivanov aivanov at openjdk.org
Fri Feb 10 15:26:51 UTC 2023


On Fri, 10 Feb 2023 11:44:35 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> test/jdk/javax/swing/JFileChooser/JFileChooserFontReset.java line 69:
>> 
>>> 67:                     Font curFont = fc.getFont();
>>> 68:                     System.out.println("current font " + curFont);
>>> 69:                     if (curFont != null && !curFont.equals(origFont)) {
>> 
>> Is it valid that `currFont` is `null`?
>> 
>> Do we expect that `origFont.equals(curFont)` returns `true`? And I assume `origFont` shouldn't be `null` either. So the condition could be simplified to
>> 
>> Suggestion:
>> 
>>                     if (!origFont.equals(curFont)) {
>
> In few cases, origFont is null. I am not sure if it's a bug or not but this issue is about L&F transition does not reset so I only checked current font should be same as original font irrespective of it being null or not.

Okay. In such a case, the null-check is required either way.

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

PR: https://git.openjdk.org/jdk/pull/12180



More information about the client-libs-dev mailing list