From bc82d23533b24a4086656afa9580c85ad60d3574 Mon Sep 17 00:00:00 2001 From: Christian Wulf <chw@informatik.uni-kiel.de> Date: Thu, 26 Mar 2015 15:22:50 +0100 Subject: [PATCH] refactored strings to constant --- .../java/teetime/framework/AbstractRunnableStage.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/teetime/framework/AbstractRunnableStage.java b/src/main/java/teetime/framework/AbstractRunnableStage.java index 6b6b04d2..096c89d3 100644 --- a/src/main/java/teetime/framework/AbstractRunnableStage.java +++ b/src/main/java/teetime/framework/AbstractRunnableStage.java @@ -20,6 +20,8 @@ import org.slf4j.LoggerFactory; abstract class AbstractRunnableStage implements Runnable { + private static final String TERMINATING_THREAD_DUE_TO_THE_FOLLOWING_EXCEPTION = "Terminating thread due to the following exception: "; + private final Stage stage; @SuppressWarnings("PMD.LoggerIsNotStaticFinal") protected final Logger logger; @@ -43,14 +45,11 @@ abstract class AbstractRunnableStage implements Runnable { afterStageExecution(stage); - } catch (Error e) { - this.logger.error("Terminating thread due to the following exception: ", e); - throw e; } catch (RuntimeException e) { - this.logger.error("Terminating thread due to the following exception: ", e); + this.logger.error(TERMINATING_THREAD_DUE_TO_THE_FOLLOWING_EXCEPTION, e); throw e; } catch (InterruptedException e) { - this.logger.error("Terminating thread due to the following exception: ", e); + this.logger.error(TERMINATING_THREAD_DUE_TO_THE_FOLLOWING_EXCEPTION, e); } this.logger.debug("Finished runnable stage. (" + stage.getId() + ")"); -- GitLab