SOLR-10778: fix (false positive) Resource Leak warning in LBHttpSolrClient.build() method.

This commit is contained in:
Christine Poerschke 2017-06-23 11:30:07 +01:00
parent 3a017e4cf2
commit ebfc04b146
1 changed files with 5 additions and 3 deletions

View File

@ -955,9 +955,11 @@ public class LBHttpSolrClient extends SolrClient {
public LBHttpSolrClient build() {
final String[] baseUrlArray = new String[baseSolrUrls.size()];
String[] solrServerUrls = baseSolrUrls.toArray(baseUrlArray);
return httpSolrClientBuilder != null ?
new LBHttpSolrClient(httpSolrClientBuilder, httpClient, solrServerUrls) :
new LBHttpSolrClient(httpClient, responseParser, solrServerUrls);
if (httpSolrClientBuilder != null) {
return new LBHttpSolrClient(httpSolrClientBuilder, httpClient, solrServerUrls);
} else {
return new LBHttpSolrClient(httpClient, responseParser, solrServerUrls);
}
}
}
}