Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8232086

[macos 10.15] java.lang.NullPointerException in java.awt.Window.init when Mac Sidecar is enable

XMLWordPrintable

    • x86
    • os_x

      ADDITIONAL SYSTEM INFORMATION :
      Mac OS X 10.15. Java versions I tested with

      openjdk version "12" 2019-03-19
      OpenJDK Runtime Environment AdoptOpenJDK (build 12+33)
      OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12+33, mixed mode, sharing)

      openjdk version "13" 2019-09-17
      OpenJDK Runtime Environment AdoptOpenJDK (build 13+33)
      OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13+33, mixed mode, sharing)

      java version "1.8.0_181"
      Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      Whenever you have Apple Sidecar enabled then Swing applications crash with a NullPointerException. Once you disconnect the iPad and run the app again the crash disappears. This is present with the Java 8, 12 and 13 I tested with.

      REGRESSION : Last worked in version 13

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Try to launch any Java application that uses the java.awt subsystem.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Application runs.
      ACTUAL -
      ─$ java DemoFrame
      Exception in thread "main" java.lang.NullPointerException
      at java.awt.Window.init(Window.java:497)
      at java.awt.Window.<init>(Window.java:537)
      at java.awt.Frame.<init>(Frame.java:420)
      at java.awt.Frame.<init>(Frame.java:385)
      at javax.swing.JFrame.<init>(JFrame.java:189)
      at DemoFrame.<init>(DemoFrame.java:3)
      at DemoFrame.main(DemoFrame.java:5)

      ---------- BEGIN SOURCE ----------
      Try to run a simple program that uses awt subsystem. For example

      public class DemoFrame extends JFrame {
        public static void main(String[] args) {
          DemoFrame frame = new DemoFrame();
        }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Disconnect the sidecar'ed ipad and rerun your application for it to start up.

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: