8190456: sanity/client/SwingSet/src/ComboBoxDemoTest.java failed with NPE from java.awt.EventQueue.getCurrentEventImpl()
Reviewed-by: serb, psadhukhan
--- a/src/java.desktop/share/classes/java/awt/EventQueue.java Thu Nov 09 15:30:11 2017 +0530
+++ b/src/java.desktop/share/classes/java/awt/EventQueue.java Thu Nov 09 15:32:52 2017 +0530
@@ -858,15 +858,13 @@
private AWTEvent getCurrentEventImpl() {
pushPopLock.lock();
try {
- if (fxAppThreadIsDispatchThread) {
+ if (Thread.currentThread() == dispatchThread
+ || fxAppThreadIsDispatchThread) {
return (currentEvent != null)
? currentEvent.get()
: null;
- } else {
- return (Thread.currentThread() == dispatchThread)
- ? currentEvent.get()
- : null;
}
+ return null;
} finally {
pushPopLock.unlock();
}