Skip to content

Commit

Permalink
Avoid hiding class field with local variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
smarsching committed Mar 18, 2024
1 parent c97376a commit a1838d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/phoebus/channelfinder/ElasticConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpCli
}

private List<String> getHostUrls() {
String hostUrls = this.hostUrls;
String localHostUrls = this.hostUrls;
boolean hostIsDefault = (host.equals("localhost"));
boolean hostUrlsIsDefault = (hostUrls.equals("http://localhost:9200"));
boolean hostUrlsIsDefault = (localHostUrls.equals("http://localhost:9200"));
boolean portIsDefault = (port == 9200);
if (hostUrlsIsDefault) {
if (!hostIsDefault || !portIsDefault) {
logger.warning("Specifying elasticsearch.network.host and elasticsearch.http.port is deprecated, please consider using elasticsearch.host_urls instead.");
hostUrls = "http://" + host + ":" + port;
localHostUrls = "http://" + host + ":" + port;
}
} else {
if (!hostIsDefault) {
Expand All @@ -173,7 +173,7 @@ private List<String> getHostUrls() {
logger.warning("Only one of elasticsearch.host_urls and elasticsearch.http.port can be set, ignoring elasticsearch.http.port.");
}
}
return Arrays.asList(hostUrls.split(","));
return Arrays.asList(localHostUrls.split(","));
}

@Bean({ "searchClient" })
Expand Down

0 comments on commit a1838d4

Please sign in to comment.