--- old/src/share/classes/java/awt/Dialog.java 2014-06-23 11:44:42.000000000 +0400 +++ new/src/share/classes/java/awt/Dialog.java 2014-06-23 11:44:42.000000000 +0400 @@ -40,6 +40,7 @@ import sun.awt.util.IdentityArrayList; import sun.awt.util.IdentityLinkedList; import java.security.AccessControlException; +import java.util.function.BooleanSupplier; /** * A Dialog is a top-level window with a title and a border @@ -1044,13 +1045,6 @@ predictedFocusOwner = getMostRecentFocusOwner(); if (conditionalShow(predictedFocusOwner, time)) { modalFilter = ModalEventFilter.createFilterForDialog(this); - final Conditional cond = new Conditional() { - @Override - public boolean evaluate() { - return windowClosingException == null; - } - }; - // if this dialog is toolkit-modal, the filter should be added // to all EDTs (for all AppContexts) if (modalityType == ModalityType.TOOLKIT_MODAL) { @@ -1063,10 +1057,7 @@ EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY); // it may occur that EDT for appContext hasn't been started yet, so // we post an empty invocation event to trigger EDT initialization - Runnable createEDT = new Runnable() { - public void run() {}; - }; - eventQueue.postEvent(new InvocationEvent(this, createEDT)); + eventQueue.postEvent(new InvocationEvent(this, () -> {})); EventDispatchThread edt = eventQueue.getDispatchThread(); edt.addEventFilter(modalFilter); } @@ -1075,12 +1066,8 @@ modalityPushed(); try { final EventQueue eventQueue = AccessController.doPrivileged( - new PrivilegedAction() { - public EventQueue run() { - return Toolkit.getDefaultToolkit().getSystemEventQueue(); - } - }); - secondaryLoop = eventQueue.createSecondaryLoop(cond, modalFilter, 0); + (PrivilegedAction) Toolkit.getDefaultToolkit()::getSystemEventQueue); + secondaryLoop = eventQueue.createSecondaryLoop(() -> true, modalFilter, 0); if (!secondaryLoop.enter()) { secondaryLoop = null; } @@ -1102,11 +1089,6 @@ edt.removeEventFilter(modalFilter); } } - - if (windowClosingException != null) { - windowClosingException.fillInStackTrace(); - throw windowClosingException; - } } } finally { if (predictedFocusOwner != null) { @@ -1134,16 +1116,6 @@ } } - void interruptBlocking() { - if (isModal()) { - disposeImpl(); - } else if (windowClosingException != null) { - windowClosingException.fillInStackTrace(); - windowClosingException.printStackTrace(); - windowClosingException = null; - } - } - private void hideAndDisposePreHandler() { isInHide = true; synchronized (getTreeLock()) {