From a48252db26e2ccd031ddb2046d87737d47c248a6 Mon Sep 17 00:00:00 2001 From: Sirisha_Manchikanti Date: Tue, 2 Nov 2021 05:35:12 +0000 Subject: Remove code smells in controlloop runtime Remove code-smells reported by sonar cloud https://sonarcloud.io/project/issues?id=onap_policy-clamp&resolved=false Issue-ID: POLICY-3540 Signed-off-by: Sirisha_Manchikanti Change-Id: I8ed1c4599e7eeebbc3a31e74cea4148eb0435847 --- .../runtime/instantiation/ControlLoopInstantiationProvider.java | 7 ++++--- .../clamp/controlloop/runtime/monitoring/MonitoringProvider.java | 8 -------- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'runtime-controlloop/src/main/java/org/onap') diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProvider.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProvider.java index 5ec6158bd..98ceacc3a 100644 --- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProvider.java +++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProvider.java @@ -90,6 +90,7 @@ public class ControlLoopInstantiationProvider { private final ParticipantProvider participantProvider; private static final Object lockit = new Object(); + private static final String ENTRY = "entry "; /** * Creates Instance Properties and Control Loop. @@ -239,7 +240,7 @@ public class ControlLoopInstantiationProvider { var result = new BeanValidationResult("ControlLoops", controlLoops); for (ControlLoop controlLoop : controlLoops.getControlLoopList()) { - var subResult = new BeanValidationResult("entry " + controlLoop.getDefinition().getName(), controlLoop); + var subResult = new BeanValidationResult(ENTRY + controlLoop.getDefinition().getName(), controlLoop); List toscaNodeTemplates = commissioningProvider.getControlLoopDefinitions( controlLoop.getDefinition().getName(), controlLoop.getDefinition().getVersion()); @@ -280,7 +281,7 @@ public class ControlLoopInstantiationProvider { */ private ValidationResult validateDefinition(Map definitions, ToscaConceptIdentifier definition) { - var result = new BeanValidationResult("entry " + definition.getName(), definition); + var result = new BeanValidationResult(ENTRY + definition.getName(), definition); ToscaConceptIdentifier identifier = definitions.get(definition.getName()); if (identifier == null) { result.setResult(ValidationStatus.INVALID, "Not FOUND"); @@ -383,7 +384,7 @@ public class ControlLoopInstantiationProvider { for (ControlLoop controlLoop : controlLoops) { for (var element : controlLoop.getElements().values()) { - var subResult = new BeanValidationResult("entry " + element.getDefinition().getName(), element); + var subResult = new BeanValidationResult(ENTRY + element.getDefinition().getName(), element); Participant p = participantMap.get(element.getParticipantId()); if (p == null) { diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/monitoring/MonitoringProvider.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/monitoring/MonitoringProvider.java index 1f6246bd6..802413a6a 100644 --- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/monitoring/MonitoringProvider.java +++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/monitoring/MonitoringProvider.java @@ -232,12 +232,4 @@ public class MonitoringProvider { } return clElementId; } - - public void updateClElementStatistics(List clElementStatistics) { - // TODO Auto-generated method stub - } - - public void updateParticipantStatistics(List statisticsList) { - // TODO Auto-generated method stub - } } -- cgit 1.2.3-korg