diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.common')
-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. + } } |