代码拉取完成,页面将自动刷新
Subject: Backport JDK-8336879 Always true condition 'img != null' in GTKPainter.paintPopupMenuBackground
---
.../classes/com/sun/java/swing/plaf/gtk/GTKPainter.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java
index 1635ff66f..6231e11d6 100644
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -610,10 +610,10 @@ class GTKPainter extends SynthPainter {
x + insets.left, y + insets.top, w - insets.left - insets.right,
h - insets.top - insets.bottom);
BufferedImage img = ENGINE.finishPainting();
- if(!isHW) {
+ if (!isHW && img != null) {
int border = img.getRGB(0, h / 2);
- if (img != null && border == img.getRGB(w / 2, h / 2)) {
- // fix no menu borders in Adwaita theme
+ if (border == img.getRGB(w / 2, h / 2)) {
+ // fix no menu borders
Graphics g2 = img.getGraphics();
Color c = new Color(border);
g2.setColor(new Color(Math.max((int) (c.getRed() * 0.8), 0),
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。