diff --git a/src/share/classes/com/sun/java/swing/SwingUtilities3.java b/src/share/classes/com/sun/java/swing/SwingUtilities3.java index 9268d7370a3c09a48a5284af70a978c9d78b9558..28d9e8af6ec91a8ed0b07d4db36d84c4823b4b48 100644 --- a/src/share/classes/com/sun/java/swing/SwingUtilities3.java +++ b/src/share/classes/com/sun/java/swing/SwingUtilities3.java @@ -133,42 +133,46 @@ public class SwingUtilities3 { } @Override - public void afterDispatch(AWTEvent event, Object handle) { + public void afterDispatch(AWTEvent event, Object handle) throws InterruptedException { afterDispatchEventArgument[0] = event; afterDispatchHandleArgument[0] = handle; try { afterDispatchCallable.call(); + } catch (InterruptedException e) { + throw e; + } catch (RuntimeException e) { + throw e; } catch (Exception e) { - if (e instanceof RuntimeException) { - throw (RuntimeException) e; - } + throw new RuntimeException(e); } } @Override - public Object beforeDispatch(AWTEvent event) { + public Object beforeDispatch(AWTEvent event) throws InterruptedException { beforeDispatchEventArgument[0] = event; try { return beforeDispatchCallable.call(); + } catch (InterruptedException e) { + throw e; + } catch (RuntimeException e) { + throw e; } catch (Exception e) { - if (e instanceof RuntimeException) { - throw (RuntimeException) e; - } + throw new RuntimeException(e); } - return null; } @Override - public AWTEvent getNextEvent(EventQueue eventQueue) { + public AWTEvent getNextEvent(EventQueue eventQueue) throws InterruptedException { getNextEventEventQueueArgument[0] = eventQueue; try { return getNextEventCallable.call(); + } catch (InterruptedException e) { + throw e; + } catch (RuntimeException e) { + throw e; } catch (Exception e) { - if (e instanceof RuntimeException) { - throw (RuntimeException) e; - } + throw new RuntimeException(e); } - return null; } } } diff --git a/src/share/classes/sun/awt/EventQueueDelegate.java b/src/share/classes/sun/awt/EventQueueDelegate.java index 8f8a6f3fe0b04e10cb15186e4237681206e4be0f..c9d0a90d2afb1b6d692c530be088d6c3a1fe01c6 100644 --- a/src/share/classes/sun/awt/EventQueueDelegate.java +++ b/src/share/classes/sun/awt/EventQueueDelegate.java @@ -58,7 +58,7 @@ public class EventQueueDelegate { * @param event to be dispatched by {@code dispatch} method * @return handle to be passed to {@code afterDispatch} method */ - public Object beforeDispatch(AWTEvent event); + public Object beforeDispatch(AWTEvent event) throws InterruptedException; /** * Notifies delegate after EventQueue.dispatch method. @@ -66,6 +66,6 @@ public class EventQueueDelegate { * @param event {@code event} dispatched by the {@code dispatch} method * @param handle object which came from {@code beforeDispatch} method */ - public void afterDispatch(AWTEvent event, Object handle); + public void afterDispatch(AWTEvent event, Object handle) throws InterruptedException; } }