diff options
author | Wiktor Garbarek <wiktor.garbarek@nokia.com> | 2018-07-03 15:53:48 +0200 |
---|---|---|
committer | Wiktor Garbarek <wiktor.garbarek@nokia.com> | 2018-07-03 15:57:53 +0200 |
commit | 6d1ca7d232210e9477a6c6040317738eb63dd809 (patch) | |
tree | bae05e3b25fe29be7e223c6c743f8ecf2dbf0797 /src | |
parent | 95207ef6f7006afca1b23d9ad72ccf2daa7e250e (diff) |
Fix bugs in Rest Client
Fixed handling InterruptedException and NullPointerException
Change-Id: I4a7f0d73394bc8c7cbdce5bc424104edcc036fe4
Issue-ID: AAI-1359
Signed-off-by: Wiktor Garbarek <wiktor.garbarek@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/onap/aai/restclient/client/RestClient.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/onap/aai/restclient/client/RestClient.java b/src/main/java/org/onap/aai/restclient/client/RestClient.java index a00c0ef..f4f184c 100644 --- a/src/main/java/org/onap/aai/restclient/client/RestClient.java +++ b/src/main/java/org/onap/aai/restclient/client/RestClient.java @@ -32,6 +32,7 @@ import java.util.concurrent.ConcurrentMap; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.MultivaluedHashMap; import javax.ws.rs.core.Response; import org.onap.aai.restclient.enums.RestAuthenticationMode; @@ -319,6 +320,7 @@ public class RestClient { } catch (InterruptedException e) { logger.error(RestClientMsgs.HTTP_REQUEST_INTERRUPTED, url, e.getLocalizedMessage()); + Thread.currentThread().interrupt(); break; } } @@ -381,7 +383,9 @@ public class RestClient { populateOperationResult(clientResponse, operationResult); // Debug log the response - debugResponse(operationResult, clientResponse.getHeaders()); + if (clientResponse != null) { + debugResponse(operationResult, clientResponse.getHeaders()); + } } catch (Exception ex) { |