mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-04 04:57:07 -08:00
See $BUG, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264356, https://bugs.openjdk.org/browse/JDK-8299417 Cherry-picked the fix that has landed in the next openjdk release. Signed-off-by: Hank Leininger <hlein@korelogic.com> Closes: https://bugs.gentoo.org/906708 Closes: https://github.com/gentoo/gentoo/pull/31091 Signed-off-by: Sam James <sam@gentoo.org>
25 lines
1.1 KiB
Diff
25 lines
1.1 KiB
Diff
From cfc9a881afd300bd7c1ce784287d1669308e89fc Mon Sep 17 00:00:00 2001
|
|
From: Sergey Bylokhov <serb@openjdk.org>
|
|
Date: Sat, 2 Jul 2022 00:25:20 +0000
|
|
Subject: [PATCH] 8288854: getLocalGraphicsEnvironment() on for multi-screen
|
|
setups throws exception NPE
|
|
|
|
Reviewed-by: azvegint, aivanov
|
|
---
|
|
.../unix/classes/sun/awt/X11GraphicsEnvironment.java | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java b/src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java
|
|
index 5c9d2a1b695..93f5eaf6656 100644
|
|
--- a/src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java
|
|
+++ b/src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java
|
|
@@ -236,7 +236,7 @@ private synchronized void initDevices() {
|
|
throw new AWTError("no screen devices");
|
|
}
|
|
int index = getDefaultScreenNum();
|
|
- mainScreen = 0 < index && index < screens.length ? index : 0;
|
|
+ mainScreen = 0 < index && index < numScreens ? index : 0;
|
|
|
|
for (int id = 0; id < numScreens; ++id) {
|
|
devices.put(id, old.containsKey(id) ? old.remove(id) :
|