Browse Source

Remove unnecessary if statement

pull/2557/merge
izeye 11 years ago committed by Stephane Nicoll
parent
commit
0073ab078d
  1. 18
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchAutoConfiguration.java

18
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchAutoConfiguration.java

@ -100,16 +100,14 @@ public class ElasticsearchAutoConfiguration implements DisposableBean { @@ -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) {

Loading…
Cancel
Save