SOLR-6220: use closeable in try block

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1677635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2015-05-04 16:46:43 +00:00
parent 1ed601dfed
commit ed975f1577
2 changed files with 6 additions and 4 deletions

View File

@ -107,9 +107,11 @@ public class SnitchContext implements RemoteCallback {
public SimpleSolrResponse invoke(UpdateShardHandler shardHandler, final String url, String path, SolrParams params)
throws IOException, SolrServerException {
GenericSolrRequest request = new GenericSolrRequest(SolrRequest.METHOD.GET, path, params);
NamedList<Object> rsp = new HttpSolrClient(url, shardHandler.getHttpClient(), new BinaryResponseParser()).request(request);
request.response.nl = rsp;
return request.response;
try (HttpSolrClient client = new HttpSolrClient(url, shardHandler.getHttpClient(), new BinaryResponseParser())) {
NamedList<Object> rsp = client.request(request);
request.response.nl = rsp;
return request.response;
}
}

View File

@ -48,7 +48,7 @@ public class GenericSolrRequest extends SolrRequest<SimpleSolrResponse> {
@Override
public Collection<ContentStream> getContentStreams() throws IOException {
return null;
return contentStreams;
}
@Override