aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-30 07:31:20 -0400
committerJim Hahn <jrh3@att.com>2020-06-30 07:40:53 -0400
commit923e08f9678123980f6e7324ddeafd6b646bcd75 (patch)
tree9fa1f52cb204c51846d54149ce903924ee1bcf73 /main/src
parentbe97f0c04fdaa1ce87db75a9701f7a1fcef009e0 (diff)
Fix more sonars in pap
Somehow missed this sonar on one line of code: - remove useless assignments Apparently, sonar only complains about some useless assignments (perhaps those that do more than copy a constant). Fixed one about which it did not complain, which appeared immediately before the one about which it DID complain. At one point, sonar complained about creating ArrayLists without specifying the initial size (when it was known). It didn't complain about this one, but went ahead and fixed it anyway. Issue-ID: POLICY-2679 Change-Id: I270341195634416db1f8152a95a5822c8d505803 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java b/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java
index 09e148b4..36f25a08 100644
--- a/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java
+++ b/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -98,11 +99,11 @@ public class PolicyComponentsHealthCheckProvider {
* @return a pair containing the status and the response
*/
public Pair<Status, Map<String, Object>> fetchPolicyComponentsHealthStatus() {
- boolean isHealthy = true;
- Map<String, Object> result = new HashMap<>();
+ boolean isHealthy;
+ Map<String, Object> result;
// Check remote components
- List<Callable<Entry<String, Object>>> tasks = new ArrayList<>();
+ List<Callable<Entry<String, Object>>> tasks = new ArrayList<>(clients.size());
for (HttpClient client : clients) {
tasks.add(() -> new AbstractMap.SimpleEntry<>(client.getName(), fetchPolicyComponentHealthStatus(client)));