Merge pull request #2557 from izeye/elasticsearch

* elasticsearch:
  Remove unnecessary if statement
This commit is contained in:
Stephane Nicoll 2015-02-26 08:30:43 +01:00
commit 65c974d7f6
1 changed files with 8 additions and 10 deletions

View File

@ -100,16 +100,14 @@ public class ElasticsearchAutoConfiguration implements DisposableBean {
if (logger.isInfoEnabled()) {
logger.info("Closing Elasticsearch client");
}
if (this.releasable != null) {
try {
this.releasable.close();
}
catch (NoSuchMethodError ex) {
// Earlier versions of Elasticsearch had a different method name
ReflectionUtils.invokeMethod(
ReflectionUtils.findMethod(Releasable.class, "release"),
this.releasable);
}
try {
this.releasable.close();
}
catch (NoSuchMethodError ex) {
// Earlier versions of Elasticsearch had a different method name
ReflectionUtils.invokeMethod(
ReflectionUtils.findMethod(Releasable.class, "release"),
this.releasable);
}
}
catch (final Exception ex) {