Used constants in the place of dup literals 03/83303/3
authorJegadeesh Babu <jegabab1@in.ibm.com>
Tue, 26 Mar 2019 08:01:39 +0000 (13:31 +0530)
committerPatrick Brady <patrick.brady@att.com>
Wed, 27 Mar 2019 21:19:51 +0000 (21:19 +0000)
Sonar fix

Issue-ID: APPC-1557
Change-Id: I4b52b9febabd0fae8aa098004aeba0ef9a085710
Signed-off-by: Jegadeesh Babu <jegabab1@in.ibm.com>
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/impl/ChefAdapterImpl.java

index 1a21c75..717c399 100644 (file)
@@ -266,6 +266,7 @@ public class ChefAdapterImpl implements ChefAdapter {
     @Override
     public void fetchResults(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException {
         int code = STATUS_OK;
+        final String LOG_STR = "fetchResults";
         try {
             chefInfo(params, ctx);
             String nodeListS = params.get(NODE_LIST_STR);
@@ -328,12 +329,12 @@ public class ChefAdapterImpl implements ChefAdapter {
             }
         } catch (JSONException e) {
             code = APPC_ERRORCODE;
-            logger.error(POSTING_REQUEST_JSON_ERROR_STR + "fetchResults", e);
-            doFailure(ctx, code, POSTING_REQUEST_JSON_ERROR_STR + "fetchResults" + e.getMessage());
+            logger.error(POSTING_REQUEST_JSON_ERROR_STR + LOG_STR, e);
+            doFailure(ctx, code, POSTING_REQUEST_JSON_ERROR_STR + LOG_STR + e.getMessage());
         } catch (Exception e) {
             code = APPC_ERRORCODE;
-            logger.error(POSTING_REQUEST_ERROR_STR + "fetchResults", e);
-            doFailure(ctx, code, POSTING_REQUEST_ERROR_STR + "fetchResults" + e.getMessage());
+            logger.error(POSTING_REQUEST_ERROR_STR + LOG_STR, e);
+            doFailure(ctx, code, POSTING_REQUEST_ERROR_STR + LOG_STR + e.getMessage());
         }
     }