From 8c87163466a4eb5a010a9977adf8a365faec8631 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Tue, 2 Oct 2018 09:50:57 -0400 Subject: Fixing sonar issues Some trivial functional interface and ordering. Added some missing JUnit tests. Issue-ID: POLICY-1129 Change-Id: Iad6fe757a40819ca39e007b41dae1bf4b3f6cc0c Signed-off-by: Pamela Dragosh --- .../policy/controlloop/policy/ControlLoop.java | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'controlloop/common/policy-yaml/src') diff --git a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/ControlLoop.java b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/ControlLoop.java index 19cca8c82..b924c2d14 100644 --- a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/ControlLoop.java +++ b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/ControlLoop.java @@ -46,6 +46,30 @@ public class ControlLoop implements Serializable { // Empty Constructor. } + /** + * Constructor. + * + * @param controlLoop copy object + */ + public ControlLoop(ControlLoop controlLoop) { + this.controlLoopName = controlLoop.controlLoopName; + this.services = new LinkedList<>(); + if (controlLoop.services != null) { + for (Service service : controlLoop.services) { + this.services.add(service); + } + } + this.resources = new LinkedList<>(); + if (controlLoop.resources != null) { + for (Resource resource : controlLoop.resources) { + this.resources.add(resource); + } + } + this.triggerPolicy = controlLoop.triggerPolicy; + this.timeout = controlLoop.timeout; + this.abatement = controlLoop.abatement; + } + public static String getCompilerVersion() { return ControlLoop.COMPILER_VERSION; } @@ -114,30 +138,6 @@ public class ControlLoop implements Serializable { this.pnf = pnf; } - /** - * Constructor. - * - * @param controlLoop copy object - */ - public ControlLoop(ControlLoop controlLoop) { - this.controlLoopName = controlLoop.controlLoopName; - this.services = new LinkedList<>(); - if (controlLoop.services != null) { - for (Service service : controlLoop.services) { - this.services.add(service); - } - } - this.resources = new LinkedList<>(); - if (controlLoop.resources != null) { - for (Resource resource : controlLoop.resources) { - this.resources.add(resource); - } - } - this.triggerPolicy = controlLoop.triggerPolicy; - this.timeout = controlLoop.timeout; - this.abatement = controlLoop.abatement; - } - @Override public String toString() { return "ControlLoop [controlLoopName=" + controlLoopName + ", version=" + version + ", services=" + services -- cgit 1.2.3-korg