summaryrefslogtreecommitdiff
path: root/java/awt/event/InvocationEvent.java
diff options
context:
space:
mode:
authorAnthony Balkissoon <abalkiss@redhat.com>2005-11-07 18:28:03 +0000
committerAnthony Balkissoon <abalkiss@redhat.com>2005-11-07 18:28:03 +0000
commit5b00bb0cd2d9c9cd4b15e9d301fd4ab9e0d0b01f (patch)
treec4964747f2861e75d469b30ae7b29b9dad40cea3 /java/awt/event/InvocationEvent.java
parent4575411e83e6db4132462d85b0a84a4e19e1b138 (diff)
downloadclasspath-5b00bb0cd2d9c9cd4b15e9d301fd4ab9e0d0b01f.tar.gz
2005-11-07 Anthony Balkissoon <abalkiss@redhat.com>
* java/awt/event/InvocationEvent.java: (throwable): New field. (getThrowable): New API method. (dispatch()): Catch Throwable, not Exception. Save the Throwable. If it is an Exception, save the Exception.
Diffstat (limited to 'java/awt/event/InvocationEvent.java')
-rw-r--r--java/awt/event/InvocationEvent.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/java/awt/event/InvocationEvent.java b/java/awt/event/InvocationEvent.java
index 75feb62bd..4abd103a6 100644
--- a/java/awt/event/InvocationEvent.java
+++ b/java/awt/event/InvocationEvent.java
@@ -107,6 +107,11 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
private Exception exception;
/**
+ * This is the caught Throwable thrown in the <code>run()</code> method.
+ */
+ private Throwable throwable;
+
+ /**
* The timestamp when this event was created.
*
* @see #getWhen()
@@ -183,9 +188,11 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
{
runnable.run();
}
- catch (Exception e)
+ catch (Throwable t)
{
- exception = e;
+ throwable = t;
+ if (t instanceof Exception)
+ exception = (Exception)t;
}
else
runnable.run();
@@ -211,6 +218,17 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
}
/**
+ * Returns a throwable caught while executing the Runnable's run() method.
+ * Null if none was thrown or if this InvocationEvent doesn't catch
+ * throwables.
+ * @return the caught Throwable
+ */
+ public Throwable getThrowable()
+ {
+ return throwable;
+ }
+
+ /**
* Gets the timestamp of when this event was created.
*
* @return the timestamp of this event