RFR: 8373650: Test "javax/swing/JMenuItem/6458123/ManualBug6458123.java" fails because the check icons are not aligned properly as expected [v4]

Tejesh R tr at openjdk.org
Mon Jan 19 11:07:58 UTC 2026


On Mon, 19 Jan 2026 08:56:32 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java line 938:
>> 
>>> 936:                                                 (icon.getIconHeight() <= 16) ? y + OFFSET : (y + icon.getIconHeight() / 2), state);
>>> 937:                                         } else {
>>> 938:                                             skin.paintSkin(g,
>> 
>> Can we optimize the code here, since mostly `x` is changing here based on conditions. It'll help in readability and review too.
>
> No, y is also changing depending on icon height...
> As of now, any more optimization is not possible, it can be done as followup if it is needed..

Line 926, 930, 936 and 940 looks same to me. I'm referring to these lines.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28889#discussion_r2704292249


More information about the client-libs-dev mailing list