diff options
author | Sergey Prigogin | 2016-09-21 22:11:14 +0000 |
---|---|---|
committer | Sergey Prigogin | 2016-09-21 22:14:19 +0000 |
commit | 44d5102c882b80772a85adec0ca3effe7da5dc52 (patch) | |
tree | 556f3a341fa837e7574c0093f3b273d00c4cd6eb | |
parent | 33d3c95f1453674b0abc5d7c61be39fd6c8c5b22 (diff) | |
download | rt.equinox.bundles-44d5102c882b80772a85adec0ca3effe7da5dc52.tar.gz rt.equinox.bundles-44d5102c882b80772a85adec0ca3effe7da5dc52.tar.xz rt.equinox.bundles-44d5102c882b80772a85adec0ca3effe7da5dc52.zip |
Bug 501778 - [common] Provide default implementation forY20160929-1000I20160927-0800
ISafeRunnable.handleException(Throwable)
Change-Id: I1f69f0701ad4034a878ecc241f867ca5078f9617
Signed-off-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
-rw-r--r-- | bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/ISafeRunnable.java | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/ISafeRunnable.java b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/ISafeRunnable.java index 0fdb53d0b..be8b3c000 100644 --- a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/ISafeRunnable.java +++ b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/ISafeRunnable.java @@ -24,31 +24,32 @@ package org.eclipse.core.runtime; */ public interface ISafeRunnable { /** - * Handles an exception thrown by this runnable's <code>run</code> - * method. The processing done here should be specific to the - * particular usecase for this runnable. Generalized exception - * processing (e.g., logging in the platform's log) is done by the - * {@link SafeRunner}. - * <p> - * All exceptions from the {@link #run} method are passed to this method, - * along with certain {@link Error} types that are typically caused by - * programming errors in the untrusted code being run. - * </p> + * Runs this runnable. Any exceptions thrown from this method will + * be logged by the caller and passed to this runnable's + * {@link #handleException} method. * - * @param exception an exception which occurred during processing - * the body of this runnable (i.e., in <code>run()</code>) + * @exception Exception if a problem occurred while running this method * @see SafeRunner#run(ISafeRunnable) */ - public void handleException(Throwable exception); + public void run() throws Exception; /** - * Runs this runnable. Any exceptions thrown from this method will - * be passed to this runnable's <code>handleException</code> - * method. + * Handles an exception thrown by this runnable's {@link #run} + * method. The processing done here should be specific to the + * particular use case for this runnable. Generalized exception + * processing, including logging in the Platform's log, is done by + * the {@link SafeRunner}. + * <p> + * All exceptions from the {@link #run} method are passed to this + * method, along with certain {@link Error} types that are typically + * caused by programming errors in the untrusted code being run. + * </p> * - * @exception Exception if a problem occurred while running this method. - * The exception will be processed by <code>handleException</code> + * @param exception an exception which occurred during processing + * the body of this runnable (i.e., in {@link #run}) * @see SafeRunner#run(ISafeRunnable) */ - public void run() throws Exception; + public default void handleException(Throwable exception) { + // The exception has already been logged by the caller. + } } |