RFR: 8336879: Always true condition 'img != null' in GTKPainter.paintPopupMenuBackground [v2]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Jul 25 12:24:35 UTC 2024
On Thu, 25 Jul 2024 04:01:03 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:
>> In GTKPainter.paintPopupMenuBackground method, `img != null` condition will always be true, because it's only checked after `img.getRGB` method is called and that means img can't be `null`. So, the null check condition is removed. CI testing is ok.
>
> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
>
> Review comment fix
Marked as reviewed by psadhukhan (Reviewer).
src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java line 613:
> 611: h - insets.top - insets.bottom);
> 612: BufferedImage img = ENGINE.finishPainting();
> 613: if(!isHW && img != null) {
space between if (
src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java line 616:
> 614: int border = img.getRGB(0, h / 2);
> 615: if (border == img.getRGB(w / 2, h / 2)) {
> 616: // fix no menu borders in Adwaita theme
since it is needed for Yaru also, then I guess it's better to remove specific mention of Adwaita
-------------
PR Review: https://git.openjdk.org/jdk/pull/20308#pullrequestreview-2199140136
PR Review Comment: https://git.openjdk.org/jdk/pull/20308#discussion_r1691349332
PR Review Comment: https://git.openjdk.org/jdk/pull/20308#discussion_r1691350189
More information about the client-libs-dev
mailing list