<Swing Dev> EventQueue NPE?

Keith Amling amling at palantir.com
Wed Feb 19 04:03:01 UTC 2014


I may be barking up the wrong tree e-mailing an OpenJDK list when I've
only reproduced this against an Oracle JDK (1.7.0_25, and in particular
it doesn't reproduce against 1.7.0_21), but the attached file produces
NPEs [1] via EventQueue.isDispatchThread() fairly regularly with an
argument of 10 [threads] and can even produce it with just 2 (although
less often).

We've had even weirder NPEs [2] in the code behind that but I have yet
to distill them to a repro unfortunately.

Are either of these known?  Is there something we should be doing in our
rather multi-threaded environment to protect this code?

Keith

[1] E.g.:

> java.lang.NullPointerException
> 	at java.awt.EventQueue.isDispatchThread(EventQueue.java:1014)
> 	at EQNPE$1.run(EQNPE.java:23)

[2] Ending in:

> java.lang.NullPointerException
> 	at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1011)
> 	at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1007)
> 	at sun.awt.HeadlessToolkit.getSystemEventQueueImpl(HeadlessToolkit.java:352)
> 	at java.awt.Toolkit.getSystemEventQueue(Toolkit.java:1717)
> 	<our code>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EQNPE.java
Type: text/x-java
Size: 1145 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20140218/b7dc0140/EQNPE.java>


More information about the swing-dev mailing list