From 8c31f39f7e587214273cb496acd0b5243a724551 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 18 Dec 2018 15:18:28 +0530 Subject: Sonar fix: AsdcApiSliClient.java Fixed sonar issues/code-smells across this file. Issue-ID: CCSDK-853 Change-Id: Ib864ab2ac5302aa9387bd19a2dfcc642d3a10f87 Signed-off-by: Arundathi Patil --- .../onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java index 02dc786a..880a2fb7 100644 --- a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiSliClient.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright © 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +35,8 @@ public class AsdcApiSliClient { private final SvcLogicService svcLogicService; + private String ErrorCode = "error-code"; + public AsdcApiSliClient(final SvcLogicService svcLogicService) { this.svcLogicService = svcLogicService; } @@ -78,12 +81,12 @@ public class AsdcApiSliClient { if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { - if (!respProps.containsKey("error-code")) { - respProps.setProperty("error-code", "500"); + if (!respProps.containsKey(ErrorCode)) { + respProps.setProperty(ErrorCode, "500"); } } else { - if (!respProps.containsKey("error-code")) { - respProps.setProperty("error-code", "200"); + if (!respProps.containsKey(ErrorCode)) { + respProps.setProperty(ErrorCode, "200"); } } -- cgit 1.2.3-korg