From ea2792e27883299b92d721c840b7368d635600fa Mon Sep 17 00:00:00 2001 From: Chris Earle Date: Tue, 1 Mar 2016 14:15:56 -0500 Subject: [PATCH] Adjusting based on comments. --- .../util/concurrent/AbstractLifecycleRunnable.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/common/util/concurrent/AbstractLifecycleRunnable.java b/core/src/main/java/org/elasticsearch/common/util/concurrent/AbstractLifecycleRunnable.java index 3ececbd6e86..30d7e63ec85 100644 --- a/core/src/main/java/org/elasticsearch/common/util/concurrent/AbstractLifecycleRunnable.java +++ b/core/src/main/java/org/elasticsearch/common/util/concurrent/AbstractLifecycleRunnable.java @@ -46,11 +46,8 @@ public abstract class AbstractLifecycleRunnable extends AbstractRunnable { * @throws NullPointerException if any parameter is {@code null} */ public AbstractLifecycleRunnable(Lifecycle lifecycle, ESLogger logger) { - Objects.requireNonNull(lifecycle, "lifecycle must not be null"); - Objects.requireNonNull(logger, "logger must not be null"); - - this.lifecycle = lifecycle; - this.logger = logger; + this.lifecycle = Objects.requireNonNull(lifecycle, "lifecycle must not be null"); + this.logger = Objects.requireNonNull(logger, "logger must not be null"); } /** @@ -63,7 +60,7 @@ public abstract class AbstractLifecycleRunnable extends AbstractRunnable { protected final void doRun() throws Exception { // prevent execution if the service is stopped if (lifecycle.stoppedOrClosed()) { - logger.trace("service is stopping. exiting"); + logger.trace("lifecycle is stopping. exiting"); return; }