[jdk19] RFR: 8288854: getLocalGraphicsEnvironment() on for multi-screen setups throws exception NPE
Sergey Bylokhov
serb at openjdk.org
Tue Jun 28 00:55:22 UTC 2022
This is the fix for a copy-paste error. The fix JDK-8076313 replaced the usage of the "screens" array from the parent class to the "devices" where the list of devices is now maintained. Since "screens" array is never used nor initialized its usage caused an NPE. That check was copied as-is, while it should use the actual number of screen devices requested early in that method.
The bug is rarely reproduced because in single screen configuration the main screen is usually 0, and in the multiscreen configuration Xinerama is usually active so the main screen is also 0 => the second part of the "if" statement is not executed.
I have validated the fix by the SwingSet, I also executed desktop tests in that config and found that even though this particular bug is fixed we still have many issues there, around ~100 tests failed.
-------------
Commit messages:
- JDK-8288854
Changes: https://git.openjdk.org/jdk19/pull/81/files
Webrev: https://webrevs.openjdk.org/?repo=jdk19&pr=81&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8288854
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk19/pull/81.diff
Fetch: git fetch https://git.openjdk.org/jdk19 pull/81/head:pull/81
PR: https://git.openjdk.org/jdk19/pull/81
More information about the client-libs-dev
mailing list