On Fri, 10 Feb 2023 16:00:56 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

>> Issue is observed that after changing the Look & Feel from Metal to Nimbus 
>> and back to Metal, the Nimbus font continues to be used by a JFileChooser.
>> This is because Synth  `installDefaults `methods set the font, but its 
>> inverse methods `uninstallDefaults `do not remove them.
>> Fix is made to reset the font if it is set by L&F.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Add both null check

test/jdk/javax/swing/JFileChooser/JFileChooserFontReset.java line 70:

> 68:                     System.out.println("current font " + curFont);
> 69:                     if ((curFont != null && !curFont.equals(origFont)) ||
> 70:                         (origFont != null && !origFont.equals(curFont))) {

The newly added condition is redundant because `origFont.equals(curFont) == 
curFont.equals(origFont)`. (It's possible `equals` returns different values but 
it violates its contract then.)

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

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

Reply via email to