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

NullPointerException at java.awt.EventQueue.isDispatchThread

XMLWordPrintable

    • b06
    • b04
    • Verified

        Sometimes java 1.5.0_65-b10 throws NullPointerException from java.awt.EventQueue.isDispatchThread.
        This reproduces only sometimes (once in 150 runs on my machine), but since the test is so quick it doesn't take long to reproduce.

        # while $JAVA_HOME/bin/java Test; do; done
        Exception in thread "main" java.lang.NullPointerException
        at java.awt.EventQueue.isDispatchThread(EventQueue.java:726)
        at Test.main(Test.java:5)

        # $JAVA_HOME/bin/java -version
        java version "1.5.0_65"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_65-b10)
        Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_65-b10, mixed mode)

        Running on Linux 3.13.6-1-ARCH x86_64 with X.Org X Server 1.15.0.

        ---- CODE ----
        import java.awt.EventQueue;

        public class Test {
          public static void main(String[] args) throws Exception {
            boolean disp = EventQueue.isDispatchThread();
          }
        }
        ---- END CODE ----

        Sleeping for 10 seconds before calling isDispatchThread did not help.
        (I tried this since I thought it might be some kind of VM startup race)

              mcherkas Mikhail Cherkasov (Inactive)
              aeriksso Andreas Eriksson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: