From 2c9ee21f2cf8fc230decfc48e3f652fe11862216 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Wed, 9 Nov 2022 12:41:32 +0000 Subject: Reduce the number of raw-type related warnings in aai-common Issue-ID: AAI-3586 Signed-off-by: Fiete Ostkamp Change-Id: If4affb02cfe40b4b82ecbdbb1a25d919d88be25c --- .../java/org/onap/aai/restclient/RestClient.java | 21 +++++++++++---------- .../restclient/RestClientFactoryConfiguration.java | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'aai-rest/src') diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java b/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java index 6fd2ab60..44b1fe44 100644 --- a/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java +++ b/aai-rest/src/main/java/org/onap/aai/restclient/RestClient.java @@ -53,7 +53,7 @@ public abstract class RestClient { * @return response of request * @throws RestClientException on internal rest template exception or invalid url */ - public ResponseEntity execute(String uri, HttpMethod method, Map headers, String body) + public ResponseEntity execute(String uri, HttpMethod method, Map headers, String body) throws RestClientException { HttpEntity httpEntity; @@ -79,7 +79,7 @@ public abstract class RestClient { throw new RestClientException(e.getMessage()); } log.debug("METHOD={}, URL={}, BODY={}", method, url, httpEntity.getBody()); - ResponseEntity responseEntity = getRestTemplate().exchange(url, method, httpEntity, String.class); + ResponseEntity responseEntity = getRestTemplate().exchange(url, method, httpEntity, String.class); log.trace("RESPONSE={}", responseEntity); return responseEntity; } @@ -94,7 +94,7 @@ public abstract class RestClient { * @return response of request * @throws RestClientException on internal rest template exception or invalid url */ - public ResponseEntity execute(String uri, String method, Map headers, String body) + public ResponseEntity execute(String uri, String method, Map headers, String body) throws RestClientException { return execute(uri, HttpMethod.valueOf(method), headers, body); } @@ -108,7 +108,7 @@ public abstract class RestClient { * @return response of request * @throws RestClientException on internal rest template exception or invalid url */ - public ResponseEntity execute(String uri, HttpMethod method, Map headers) + public ResponseEntity execute(String uri, HttpMethod method, Map headers) throws RestClientException { return execute(uri, method, headers, null); } @@ -122,14 +122,15 @@ public abstract class RestClient { * @return response of request * @throws RestClientException on internal rest template exception or invalid url */ - public ResponseEntity execute(String uri, String method, Map headers) throws RestClientException { + public ResponseEntity execute(String uri, String method, Map headers) + throws RestClientException { return execute(uri, HttpMethod.valueOf(method), headers, null); } - public ResponseEntity executeResource(String uri, HttpMethod method, Map headers, String body) - throws RestClientException { + public ResponseEntity executeResource(String uri, HttpMethod method, Map headers, + String body) throws RestClientException { - HttpEntity httpEntity; + HttpEntity httpEntity; log.debug("Headers: " + headers.toString()); if (body == null) { httpEntity = new HttpEntity(getHeaders(headers)); @@ -140,12 +141,12 @@ public abstract class RestClient { return getRestTemplate().exchange(url, method, httpEntity, Resource.class); } - public ResponseEntity getGetRequest(String content, String uri, Map headersMap) { + public ResponseEntity getGetRequest(String content, String uri, Map headersMap) { return this.execute(uri, HttpMethod.GET, headersMap, content); } - public ResponseEntity getGetResource(String content, String uri, Map headersMap) { + public ResponseEntity getGetResource(String content, String uri, Map headersMap) { return this.executeResource(uri, HttpMethod.GET, headersMap, content); } diff --git a/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java index 08060238..9a28c1cb 100644 --- a/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java +++ b/aai-rest/src/main/java/org/onap/aai/restclient/RestClientFactoryConfiguration.java @@ -20,7 +20,6 @@ package org.onap.aai.restclient; -import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.config.ServiceLocatorFactoryBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -28,8 +27,9 @@ import org.springframework.context.annotation.Configuration; @Configuration public class RestClientFactoryConfiguration { + // ServiceLocatorFactoryBean @Bean - public FactoryBean restClientFactoryBean() { + public ServiceLocatorFactoryBean restClientFactoryBean() { ServiceLocatorFactoryBean factoryBean = new ServiceLocatorFactoryBean(); factoryBean.setServiceLocatorInterface(RestClientFactory.class); return factoryBean; -- cgit 1.2.3-korg