changeset 56590:a9b346a481d7

8229810: [macos] NullPointerException getting bounds of GraphicsConfiguration Reviewed-by: jdv
author serb
date Wed, 09 Oct 2019 17:06:06 -0700
parents bdf0a922ae8a
children 7a57470d0500
files src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java	Thu Oct 03 18:17:54 2019 -0700
+++ b/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java	Wed Oct 09 17:06:06 2019 -0700
@@ -61,6 +61,10 @@
     public CGraphicsDevice(final int displayID) {
         this.displayID = displayID;
         config = CGLGraphicsConfig.getConfig(this, displayID, 0);
+        // initializes default device state, might be redundant step since we
+        // call "displayChanged()" later anyway, but we do not want to leave the
+        // device in an inconsistent state after construction
+        displayChanged();
     }
 
     /**