Skip to content

Commit

Permalink
[grid] Fix incompatible type and make the build work again
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Mar 13, 2020
1 parent d9f7cef commit e081e63
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLEncoder;
import java.util.ArrayList;
Expand Down Expand Up @@ -111,7 +112,14 @@ public HttpResponse execute(HttpRequest req) throws UncheckedIOException {
List<String> queryPairs = new ArrayList<>();
req.getQueryParameterNames().forEach(
name -> req.getQueryParameters(name).forEach(
value -> queryPairs.add(URLEncoder.encode(name, UTF_8) + "=" + URLEncoder.encode(value, UTF_8))));
value -> {
try {
queryPairs.add(URLEncoder.encode(name, UTF_8.toString()) + "=" + URLEncoder.encode(value, UTF_8.toString()));
} catch (UnsupportedEncodingException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}));
if (!queryPairs.isEmpty()) {
uri.append("?");
Joiner.on('&').appendTo(uri, queryPairs);
Expand Down

0 comments on commit e081e63

Please sign in to comment.