changeset 47902:51010df5ecb1

8190456: sanity/client/SwingSet/src/ComboBoxDemoTest.java failed with NPE from java.awt.EventQueue.getCurrentEventImpl() Reviewed-by: serb, psadhukhan
author akolarkunnu
date Thu, 09 Nov 2017 15:32:52 +0530
parents 8a3c1bdf9ecb
children fd3c961a89ec
files src/java.desktop/share/classes/java/awt/EventQueue.java
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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();
         }