fixed sonar issues in SetNodeExecutor.java 96/74696/2
authorSandeep J <sandeejh@in.ibm.com>
Mon, 17 Dec 2018 06:20:00 +0000 (11:50 +0530)
committerSandeep Jha <sandeejh@in.ibm.com>
Mon, 17 Dec 2018 11:29:01 +0000 (11:29 +0000)
fixed sonar issues

Issue-ID: CCSDK-525
Change-Id: I58252cf9acb9eb1c5b70d6137e7b725f036d114f
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SetNodeExecutor.java

index 8bebb33..caf0015 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
  *                      reserved.
  * ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -111,7 +113,7 @@ public class SetNodeExecutor extends AbstractSvcLogicNodeExecutor {
                             lhsPrefix = lhsPrefix.substring(0, lhsPrefix.length() - 1);
                         }
 
-                        HashMap<String, String> parmsToAdd = new HashMap<String, String>();
+                        HashMap<String, String> parmsToAdd = new HashMap<>();
 
                         for (String sourceVarName : ctx.getAttributeKeySet()) {
                             if (sourceVarName.startsWith(rhsRoot)) {
@@ -125,7 +127,7 @@ public class SetNodeExecutor extends AbstractSvcLogicNodeExecutor {
                         }
                     } else {
                         // If RHS is empty, unset attributes in LHS
-                        LinkedList<String> parmsToRemove = new LinkedList<String>();
+                        LinkedList<String> parmsToRemove = new LinkedList<>();
                         String prefix = lhsVarName + ".";
                         String arrayPrefix = lhsVarName + "[";
                         //Clear length value in case an array exists with this prefix
@@ -143,10 +145,10 @@ public class SetNodeExecutor extends AbstractSvcLogicNodeExecutor {
                                 LOG.debug("Unsetting {} because matching value {} starts with the prefix {}", curCtxVarname, curCtxVarnameMatchingValue, prefix);
                                 parmsToRemove.add(curCtxVarname);
                             }else if (curCtxVarnameMatchingValue.startsWith(lengthParamName)) {
-                               LOG.debug("Unsetting {} because matching value {} starts with the lengthParamName {}", curCtxVarname, curCtxVarnameMatchingValue, lengthParamName);
+                                LOG.debug("Unsetting {} because matching value {} starts with the lengthParamName {}", curCtxVarname, curCtxVarnameMatchingValue, lengthParamName);
                                 parmsToRemove.add(curCtxVarname);
                             }else if (curCtxVarnameMatchingValue.startsWith(arrayPrefix)) {
-                               LOG.debug("Unsetting {} because matching value {} starts with the arrayPrefix {}", curCtxVarname, curCtxVarnameMatchingValue, arrayPrefix);
+                                LOG.debug("Unsetting {} because matching value {} starts with the arrayPrefix {}", curCtxVarname, curCtxVarnameMatchingValue, arrayPrefix);
                                 parmsToRemove.add(curCtxVarname);
                             }
                         }