8190456: sanity/client/SwingSet/src/ComboBoxDemoTest.java failed with NPE from java.awt.EventQueue.getCurrentEventImpl()
authorakolarkunnu
Thu, 09 Nov 2017 15:32:52 +0530
changeset 47829 51010df5ecb1
parent 47828 8a3c1bdf9ecb
child 47830 fd3c961a89ec
8190456: sanity/client/SwingSet/src/ComboBoxDemoTest.java failed with NPE from java.awt.EventQueue.getCurrentEventImpl() Reviewed-by: serb, psadhukhan
src/java.desktop/share/classes/java/awt/EventQueue.java
--- 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();
         }