summaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-policy/src/main
diff options
context:
space:
mode:
authorTaka Cho <takamune.cho@att.com>2021-08-17 14:23:26 -0400
committerTaka Cho <takamune.cho@att.com>2021-08-20 17:16:49 -0400
commitbf06e83f40cdbfcfc1428040bf8fa58a518cdea4 (patch)
tree6bf66e14c5e340f4faa8e08cf7404e40cc6e4096 /participant/participant-impl/participant-impl-policy/src/main
parent172f990bd92e1441eca6dd161458efddb674b2fc (diff)
sonar fix for clamp
- bug: added InterruptedException for sleep - vulns: two false positve - removed some unused import - changed to use var for local variable Issue-ID: POLICY-3452 Change-Id: I8b4be1378a2aad8f68562b63f70853832673ce97 Signed-off-by: Taka Cho <takamune.cho@att.com>
Diffstat (limited to 'participant/participant-impl/participant-impl-policy/src/main')
-rw-r--r--participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/handler/ControlLoopElementHandler.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/handler/ControlLoopElementHandler.java b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/handler/ControlLoopElementHandler.java
index 60515048e..0e19ea33e 100644
--- a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/handler/ControlLoopElementHandler.java
+++ b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/controlloop/participant/policy/main/handler/ControlLoopElementHandler.java
@@ -2,6 +2,8 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Nordix Foundation.
* ================================================================================
+ * Modifications Copyright (C) 2021 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.
* You may obtain a copy of the License at
@@ -98,7 +100,7 @@ public class ControlLoopElementHandler implements ControlLoopElementListener {
}
}
- private void deletePolicyData(UUID controlLoopElementId, ControlLoopOrderedState newState) throws PfModelException {
+ private void deletePolicyData(UUID controlLoopElementId, ControlLoopOrderedState newState) {
// Delete all policies of this controlLoop from policy framework
for (Entry<String, String> policy : policyMap.entrySet()) {
apiHttpClient.deletePolicy(policy.getKey(), policy.getValue());
@@ -155,9 +157,9 @@ public class ControlLoopElementHandler implements ControlLoopElementListener {
*/
@Override
public void handleStatistics(UUID controlLoopElementId) throws PfModelException {
- ControlLoopElement clElement = intermediaryApi.getControlLoopElement(controlLoopElementId);
+ var clElement = intermediaryApi.getControlLoopElement(controlLoopElementId);
if (clElement != null) {
- ClElementStatistics clElementStatistics = new ClElementStatistics();
+ var clElementStatistics = new ClElementStatistics();
clElementStatistics.setControlLoopState(clElement.getState());
clElementStatistics.setTimeStamp(Instant.now());
intermediaryApi.updateControlLoopElementStatistics(controlLoopElementId, clElementStatistics);