From 923e08f9678123980f6e7324ddeafd6b646bcd75 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 30 Jun 2020 07:31:20 -0400 Subject: 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 --- .../policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java | 7 ++++--- 1 file 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> fetchPolicyComponentsHealthStatus() { - boolean isHealthy = true; - Map result = new HashMap<>(); + boolean isHealthy; + Map result; // Check remote components - List>> tasks = new ArrayList<>(); + List>> tasks = new ArrayList<>(clients.size()); for (HttpClient client : clients) { tasks.add(() -> new AbstractMap.SimpleEntry<>(client.getName(), fetchPolicyComponentHealthStatus(client))); -- cgit 1.2.3-korg