Use Map's entrySet instead of keySet 93/14993/2
authorsurya-huawei <a.u.surya@huawei.com>
Mon, 25 Sep 2017 09:12:11 +0000 (14:42 +0530)
committerSURYA A U <a.u.surya@huawei.com>
Mon, 25 Sep 2017 09:21:18 +0000 (09:21 +0000)
Major Sonar issue in sli/adaptors module
*When both keys and values of map are used,
 using entrySet is more efficient

Issue-Id: CCSDK-87
Change-Id: I1a8df0bc42de2c75b5217fd2570fb579d1897760
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java

index 447da3f..f1663d2 100755 (executable)
@@ -1580,8 +1580,8 @@ public abstract class AAIDeclarations implements AAIClient {
                     j++;
                 }
                     AAIRequest rlRequest = AAIRequest.createRequest(relatedTo, relParams);
-                    for(String key : relParams.keySet()) {
-                        rlRequest.addRequestProperty(key, relParams.get(key));
+                    for(Map.Entry<String,String> entry : relParams.entrySet()) {
+                        rlRequest.addRequestProperty(entry.getKey(), entry.getValue());
                     }
                     String path = rlRequest.updatePathDataValues(null);
                     relationship.setRelatedLink(path);