src/share/classes/java/awt/Container.java

Print this page

        

@@ -2897,21 +2897,14 @@
             else {
                 nativeContainer.modalComp = this;
             }
         }
 
-        Runnable pumpEventsForHierarchy = new Runnable() {
-            public void run() {
-                EventDispatchThread dispatchThread =
-                    (EventDispatchThread)Thread.currentThread();
-                dispatchThread.pumpEventsForHierarchy(
-                        new Conditional() {
-                        public boolean evaluate() {
-                        return ((windowClosingException == null) && (nativeContainer.modalComp != null)) ;
-                        }
-                        }, Container.this);
-            }
+        Runnable pumpEventsForHierarchy = () -> {
+            EventDispatchThread dispatchThread = (EventDispatchThread)Thread.currentThread();
+            dispatchThread.pumpEventsForHierarchy(() -> nativeContainer.modalComp != null,
+                    Container.this);
         };
 
         if (EventQueue.isDispatchThread()) {
             SequencedEvent currentSequencedEvent =
                 KeyboardFocusManager.getCurrentKeyboardFocusManager().

@@ -2925,25 +2918,20 @@
             synchronized (getTreeLock()) {
                 Toolkit.getEventQueue().
                     postEvent(new PeerEvent(this,
                                 pumpEventsForHierarchy,
                                 PeerEvent.PRIORITY_EVENT));
-                while ((windowClosingException == null) &&
-                       (nativeContainer.modalComp != null))
+                while (nativeContainer.modalComp != null)
                 {
                     try {
                         getTreeLock().wait();
                     } catch (InterruptedException e) {
                         break;
                     }
                 }
             }
         }
-        if (windowClosingException != null) {
-            windowClosingException.fillInStackTrace();
-            throw windowClosingException;
-        }
         if (predictedFocusOwner != null) {
             KeyboardFocusManager.getCurrentKeyboardFocusManager().
                 dequeueKeyEvents(time, predictedFocusOwner);
         }
     }