summaryrefslogtreecommitdiffstats
path: root/sparkybe-onap-service/src/main/java
diff options
context:
space:
mode:
authorDriptaroop Das <driptaroop.das@in.ibm.com>2019-01-16 23:51:47 +0530
committerDriptaroop Das <driptaroop.das@in.ibm.com>2019-01-16 23:51:57 +0530
commit85e26c8fe34bf0964fb90b17219dffc1421ac383 (patch)
treeb3622d23efd384b86c9575b007862b3202d468c1 /sparkybe-onap-service/src/main/java
parentacfc65b5eca0c6ad28faca4c8aa59d522eeb8de3 (diff)
Sonar Fix VnfSearchQueryBuilder
Sonar Fix VnfSearchQueryBuilder Issue-ID: AAI-2084 Change-Id: I608d7592717ee9b74d4e7641051cfbb62c498315 Signed-off-by: Driptaroop Das <driptaroop.das@in.ibm.com>
Diffstat (limited to 'sparkybe-onap-service/src/main/java')
-rw-r--r--sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java
index c833bd3..dd14db8 100644
--- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java
+++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* Copyright © 2017-2018 Amdocs
+ * Copyright © 2019 IBM
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -102,8 +103,8 @@ public class VnfSearchQueryBuilder {
JsonObjectBuilder queryBlobBuilder = Json.createObjectBuilder();
JsonObjectBuilder aggsBlobBuilder = Json.createObjectBuilder();
JsonArrayBuilder mustBlobBuilder = Json.createArrayBuilder();
- for (String key : attributes.keySet()) {
- mustBlobBuilder.add(getTermBlob(key, attributes.get(key)));
+ for (Map.Entry<String, String> entry : attributes.entrySet()) {
+ mustBlobBuilder.add(getTermBlob(entry.getKey(), entry.getValue()));
}
JsonArray mustBlob = mustBlobBuilder.build();
@@ -127,8 +128,8 @@ public class VnfSearchQueryBuilder {
public static void buildMultiTermCountQuery(JsonObjectBuilder jsonBuilder,
Map<String, String> attributes) {
JsonArrayBuilder mustBlobBuilder = Json.createArrayBuilder();
- for (String key : attributes.keySet()) {
- mustBlobBuilder.add(getTermBlob(key, attributes.get(key)));
+ for (Map.Entry<String, String> entry : attributes.entrySet()) {
+ mustBlobBuilder.add(getTermBlob(entry.getKey(), entry.getValue()));
}
jsonBuilder.add("query", Json.createObjectBuilder().add("bool",
Json.createObjectBuilder().add("must", mustBlobBuilder)));