mirror of https://github.com/apache/lucene.git
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:
parent
1ed601dfed
commit
ed975f1577
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public class GenericSolrRequest extends SolrRequest<SimpleSolrResponse> {
|
|||
|
||||
@Override
|
||||
public Collection<ContentStream> getContentStreams() throws IOException {
|
||||
return null;
|
||||
return contentStreams;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue