summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Blimkie <Steven.Blimkie@amdocs.com>2019-02-20 16:41:01 +0000
committerGerrit Code Review <gerrit@onap.org>2019-02-20 16:41:01 +0000
commit57a8790c14e46593d88f74a54d61b68b8d5af06e (patch)
tree41405a6e5eaa453087752457cad3099f2783b532
parent9898634b32ce6bd4d468f399bcc4899054e5ace8 (diff)
parent85e26c8fe34bf0964fb90b17219dffc1421ac383 (diff)
Merge "Sonar Fix VnfSearchQueryBuilder"
-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)));