From 02e53719ea41f24eb53ddb4de7d8303cec60aa15 Mon Sep 17 00:00:00 2001 From: Javier <10879637+javiertuya@users.noreply.github.com> Date: Sun, 30 Jun 2024 08:25:36 +0200 Subject: [PATCH] Fix sonar issue --- .../java/giis/tdrules/store/loader/oa/ApiWriter.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tdrules-store-loader/src/main/java/giis/tdrules/store/loader/oa/ApiWriter.java b/tdrules-store-loader/src/main/java/giis/tdrules/store/loader/oa/ApiWriter.java index 726185e..686c1d1 100644 --- a/tdrules-store-loader/src/main/java/giis/tdrules/store/loader/oa/ApiWriter.java +++ b/tdrules-store-loader/src/main/java/giis/tdrules/store/loader/oa/ApiWriter.java @@ -63,12 +63,11 @@ private ApiResponse apiExecute(HttpUriRequest request) { request.setHeader(header[0], header[1]); ApiResponse result; - try (final CloseableHttpClient client = HttpClients.createDefault()) { - result = client.execute(request, response -> { - return new ApiResponse(response.getCode(), - response.getReasonPhrase(), - EntityUtils.toString(response.getEntity())); - }); + try (CloseableHttpClient client = HttpClients.createDefault()) { + result = client.execute(request, response -> + new ApiResponse(response.getCode(), response.getReasonPhrase(), + EntityUtils.toString(response.getEntity()) + )); } catch (Exception e) { throw new LoaderException(e); }