diff options
author | Jorge Hernandez <jh1730@att.com> | 2017-09-25 13:54:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-25 13:54:48 +0000 |
commit | e9298664517c7c83d33e210c8d532f8145b71d33 (patch) | |
tree | 664586f47e9867bd4b14059ac4a2683eb1ac551f /controlloop/common | |
parent | 43731b275d43e106a38e2c490b894b0022fef129 (diff) | |
parent | eb04e2e81ae3402fe7ad899f34495469b4c7514e (diff) |
Merge "Fix Blocker/Critical sonar issues"
Diffstat (limited to 'controlloop/common')
2 files changed, 8 insertions, 4 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java index ec99c1a5c..10cf173fc 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java @@ -190,7 +190,7 @@ public class ControlLoopOperationManager implements Serializable { this.policyResult = null; Operation operation = new Operation(); operation.attempt = ++this.attempts; - operation.operation.actor = this.policy.getActor().toString(); + operation.operation.actor = this.policy.getActor(); operation.operation.operation = this.policy.getRecipe(); operation.operation.target = this.policy.getTarget().toString(); operation.operation.subRequestId = Integer.toString(operation.attempt); @@ -421,7 +421,8 @@ public class ControlLoopOperationManager implements Serializable { if (this.currentOperation != null && this.currentOperation.operation != null) { return this.currentOperation.operation.toMessage(); } - if (this.operationHistory != null && this.operationHistory.size() > 0) { + + if (!this.operationHistory.isEmpty()) { return this.operationHistory.getLast().operation.toMessage(); } return null; @@ -431,7 +432,8 @@ public class ControlLoopOperationManager implements Serializable { if (this.currentOperation != null && this.currentOperation.operation != null) { return this.currentOperation.operation.toMessage()+ ", Guard result: " + guardResult; } - if (this.operationHistory != null && this.operationHistory.size() > 0) { + + if (!this.operationHistory.isEmpty()) { return this.operationHistory.getLast().operation.toMessage() + ", Guard result: " + guardResult; } return null; @@ -441,7 +443,8 @@ public class ControlLoopOperationManager implements Serializable { if (this.currentOperation != null && this.currentOperation.operation != null) { return this.currentOperation.operation.toHistory(); } - if (this.operationHistory != null && this.operationHistory.size() > 0) { + + if (!this.operationHistory.isEmpty()) { return this.operationHistory.getLast().operation.toHistory(); } return null; diff --git a/controlloop/common/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/LCMResponseCode.java b/controlloop/common/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/LCMResponseCode.java index 484e793e2..85427c468 100644 --- a/controlloop/common/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/LCMResponseCode.java +++ b/controlloop/common/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/LCMResponseCode.java @@ -41,6 +41,7 @@ public class LCMResponseCode { return this.code; } + @Override public String toString() { return Integer.toString(this.code); } |