From 1d06916b07b1f6a59e57b4d3d1ded9ce426bfefe Mon Sep 17 00:00:00 2001 From: javanna Date: Wed, 18 May 2016 11:39:59 +0200 Subject: [PATCH] adapt params argument, they can only be Strings in performRequest method --- .../main/java/org/elasticsearch/client/RestClient.java | 8 ++++---- .../java/org/elasticsearch/client/sniff/HostsSniffer.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/main/java/org/elasticsearch/client/RestClient.java b/client/src/main/java/org/elasticsearch/client/RestClient.java index e27949a9751..23540049fb5 100644 --- a/client/src/main/java/org/elasticsearch/client/RestClient.java +++ b/client/src/main/java/org/elasticsearch/client/RestClient.java @@ -77,7 +77,7 @@ public final class RestClient implements Closeable { this.connections = Collections.unmodifiableList(connections); } - public ElasticsearchResponse performRequest(String method, String endpoint, Map params, + public ElasticsearchResponse performRequest(String method, String endpoint, Map params, HttpEntity entity, Header... headers) throws IOException { URI uri = buildUri(endpoint, params); HttpRequestBase request = createHttpRequest(method, uri, entity); @@ -252,11 +252,11 @@ public final class RestClient implements Closeable { } } - private static URI buildUri(String path, Map params) { + private static URI buildUri(String path, Map params) { try { URIBuilder uriBuilder = new URIBuilder(path); - for (Map.Entry param : params.entrySet()) { - uriBuilder.addParameter(param.getKey(), param.getValue().toString()); + for (Map.Entry param : params.entrySet()) { + uriBuilder.addParameter(param.getKey(), param.getValue()); } return uriBuilder.build(); } catch(URISyntaxException e) { diff --git a/client/src/main/java/org/elasticsearch/client/sniff/HostsSniffer.java b/client/src/main/java/org/elasticsearch/client/sniff/HostsSniffer.java index 29117fcd856..86dca173a67 100644 --- a/client/src/main/java/org/elasticsearch/client/sniff/HostsSniffer.java +++ b/client/src/main/java/org/elasticsearch/client/sniff/HostsSniffer.java @@ -45,13 +45,13 @@ public class HostsSniffer { private static final Log logger = LogFactory.getLog(HostsSniffer.class); private final RestClient restClient; - private final Map sniffRequestParams; + private final Map sniffRequestParams; private final String scheme; private final JsonFactory jsonFactory; public HostsSniffer(RestClient restClient, int sniffRequestTimeout, String scheme) { this.restClient = restClient; - this.sniffRequestParams = Collections.singletonMap("timeout", sniffRequestTimeout + "ms"); + this.sniffRequestParams = Collections.singletonMap("timeout", sniffRequestTimeout + "ms"); this.scheme = scheme; this.jsonFactory = new JsonFactory(); }