-
Bug
-
Resolution: Fixed
-
P3
-
11, 12.0.2, 13, 14
-
b19
-
x86
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8245279 | 13.0.4 | Sergey Bylokhov | P3 | Resolved | Fixed | b02 |
JDK-8232701 | 11.0.6-oracle | Sergey Bylokhov | P3 | Resolved | Fixed | b02 |
JDK-8234561 | 11.0.6 | Sergey Bylokhov | P3 | Resolved | Fixed | b05 |
ADDITIONAL SYSTEM INFORMATION :
macOS Mojave 10.14.5 (MacBook Pro)
openjdk version "12.0.2" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 12.0.2+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12.0.2+10, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
The method java.awt.GraphicsConfiguration#getBounds can throw a NullPointerException when disconnecting displays.
REGRESSION : Last worked in version 11.0.4
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached code on a MacBook Pro.
While that is running:
1) Plug in an external display to the laptop
2) Close the laptop lid
3) Unplug the external display
-> Exception is thrown here
4) Open the laptop lid
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No exception is thrown
ACTUAL -
Exception in thread "main" java.lang.NullPointerException
at java.desktop/sun.awt.CGraphicsDevice.getBounds(CGraphicsDevice.java:116)
at java.desktop/sun.awt.CGraphicsConfig.getBounds(CGraphicsConfig.java:57)
at Main.main(Main.java:10)
---------- BEGIN SOURCE ----------
import java.awt.*;
public class Main {
public static void main(String[] args) {
while (true) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
for (GraphicsDevice gd : ge.getScreenDevices()) {
GraphicsConfiguration gc = gd.getDefaultConfiguration();
gc.getBounds();
}
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Catch the exception and ignore it.
FREQUENCY : occasionally
macOS Mojave 10.14.5 (MacBook Pro)
openjdk version "12.0.2" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 12.0.2+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12.0.2+10, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
The method java.awt.GraphicsConfiguration#getBounds can throw a NullPointerException when disconnecting displays.
REGRESSION : Last worked in version 11.0.4
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached code on a MacBook Pro.
While that is running:
1) Plug in an external display to the laptop
2) Close the laptop lid
3) Unplug the external display
-> Exception is thrown here
4) Open the laptop lid
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No exception is thrown
ACTUAL -
Exception in thread "main" java.lang.NullPointerException
at java.desktop/sun.awt.CGraphicsDevice.getBounds(CGraphicsDevice.java:116)
at java.desktop/sun.awt.CGraphicsConfig.getBounds(CGraphicsConfig.java:57)
at Main.main(Main.java:10)
---------- BEGIN SOURCE ----------
import java.awt.*;
public class Main {
public static void main(String[] args) {
while (true) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
for (GraphicsDevice gd : ge.getScreenDevices()) {
GraphicsConfiguration gc = gd.getDefaultConfiguration();
gc.getBounds();
}
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Catch the exception and ignore it.
FREQUENCY : occasionally
- backported by
-
JDK-8232701 [macos] NullPointerException getting bounds of GraphicsConfiguration
- Resolved
-
JDK-8234561 [macos] NullPointerException getting bounds of GraphicsConfiguration
- Resolved
-
JDK-8245279 [macos] NullPointerException getting bounds of GraphicsConfiguration
- Resolved
- relates to
-
JDK-8229821 [macos] IllegalArgumentException thrown when unplugging external monitor
- Closed
- links to