You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2017/06/23 15:52:42 UTC
[3/4] lucene-solr:master: SOLR-10778: fix (false positive) Resource
Leak warning in LBHttpSolrClient.build() method.
SOLR-10778: fix (false positive) Resource Leak warning in LBHttpSolrClient.build() method.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/ebfc04b1
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/ebfc04b1
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/ebfc04b1
Branch: refs/heads/master
Commit: ebfc04b1468b4a7973f61bafc94688630629806b
Parents: 3a017e4
Author: Christine Poerschke <cp...@apache.org>
Authored: Fri Jun 23 11:30:07 2017 +0100
Committer: Christine Poerschke <cp...@apache.org>
Committed: Fri Jun 23 15:47:25 2017 +0100
----------------------------------------------------------------------
.../org/apache/solr/client/solrj/impl/LBHttpSolrClient.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ebfc04b1/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java
index 2e51bbc..dbb99ce 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java
@@ -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);
+ }
}
}
}