From 06482e842433a4f0532720cb26f217b17326dac3 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 4 May 2015 14:55:10 -0400 Subject: [PATCH] Use Releasables.close here --- src/main/java/org/elasticsearch/bootstrap/Bootstrap.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java b/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java index 8318fae0726..74e8ec62cbc 100644 --- a/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java +++ b/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java @@ -30,6 +30,7 @@ import org.elasticsearch.common.inject.spi.Message; import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.jna.Kernel32Library; import org.elasticsearch.common.jna.Natives; +import org.elasticsearch.common.lease.Releasables; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.logging.log4j.LogConfigurator; @@ -177,9 +178,7 @@ public class Bootstrap { private void stop() { try { - if (node != null) { - node.close(); - } + Releasables.close(node); } finally { keepAliveLatch.countDown(); }