From 803c1b6abe08930600c47c72d8449e836d5259a2 Mon Sep 17 00:00:00 2001 From: rama-huawei Date: Tue, 17 Oct 2017 15:44:36 +0530 Subject: Iterate over the entrySet instead of keySet Issue-id: SO-214 Change-Id: I3f417fee04ae1fe2c1d0b7361ec0272e1b098302 Signed-off-by: rama-huawei --- .../mso/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'adapters/mso-sdnc-adapter/src') diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java index f0fcf18afd..ab2c4eff2c 100644 --- a/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java +++ b/adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java @@ -43,6 +43,7 @@ import org.openecomp.mso.logger.MsoLogger; public class SDNCServiceRequestConnector extends SDNCConnector { private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); + private static final String YES = "Y"; @Override protected SDNCResponseCommon createResponseFromContent(int statusCode, String statusMessage, String responseContent, TypedRequestTunables rt) { @@ -57,7 +58,7 @@ public class SDNCServiceRequestConnector extends SDNCConnector { @Override protected SDNCErrorCommon createErrorResponse(int statusCode, String errMsg, TypedRequestTunables rt) { - return new SDNCServiceError(rt.getReqId(), String.valueOf(statusCode), errMsg, "Y"); + return new SDNCServiceError(rt.getReqId(), String.valueOf(statusCode), errMsg, YES); } /** @@ -133,10 +134,10 @@ public class SDNCServiceRequestConnector extends SDNCConnector { // ack-final-indicator is optional: default to "Y". if (ackFinalIndicator == null || ackFinalIndicator.trim().isEmpty()) { - ackFinalIndicator = "Y"; + ackFinalIndicator = YES; } - if (!ackFinalIndicator.equals("Y") && !"N".equals(ackFinalIndicator)) { + if (!YES.equals(ackFinalIndicator) && !"N".equals(ackFinalIndicator)) { throw new ParseException("Invalid ack-final-indicator in SDNC response: '" + ackFinalIndicator + "'", 0); } -- cgit 1.2.3-korg