diff options
author | shashikanth <shashikanth.vh@huawei.com> | 2017-09-26 15:36:17 +0530 |
---|---|---|
committer | Shashikanth VH <shashikanth.vh@huawei.com> | 2017-09-27 04:58:42 +0000 |
commit | 23390e1a8ac5705ccd6853b0bc80d3a04707a3d9 (patch) | |
tree | 5682fbb629fa1714d8649a5a74dcd4c9b17cee50 | |
parent | 83e5f06aef61e32463c97241fd6a5cfef6679206 (diff) |
Fix major sonar issues
Fix major sonar issues in policy/drools-applications module
https://sonar.onap.org/component_issues?id=org.onap.policy.drools-applications%3Adrools-pdp-apps#resolved=false|severities=MAJOR|rules=squid%3AS1132
Fixed string literal comparison for for SO and VF Module Create and few optimizations.
Issue-Id:POLICY-239
Change-Id: I8e228463ebc7f3114e5caba9b423552bb84dd52d
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
-rw-r--r-- | controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java b/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java index a014c7a80..8c1b23af9 100644 --- a/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java +++ b/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java @@ -136,10 +136,10 @@ public class SOActorServiceProvider implements Actor { } - /** + /** * Constructs and sends an AAI vserver Named Query * - * @param eventRequestID + * @param onset * @returns the response to the AAI Named Query */ private AAINQResponseWrapper AaiNamedQueryRequest(VirtualControlLoopEvent onset) { @@ -239,9 +239,9 @@ public class SOActorServiceProvider implements Actor { int nonBaseIndex = -1; List<AAINQInventoryResponseItem> inventoryItems = namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems; for (AAINQInventoryResponseItem m : inventoryItems) { - if (m.vfModule != null && m.vfModule.isBaseVfModule == true) { + if (m.vfModule != null && m.vfModule.isBaseVfModule) { baseIndex = inventoryItems.indexOf(m); - } else if (m.vfModule != null && m.vfModule.isBaseVfModule == false && m.vfModule.orchestrationStatus == null) { + } else if (m.vfModule != null && m.vfModule.orchestrationStatus == null) { nonBaseIndex = inventoryItems.indexOf(m); } // @@ -302,7 +302,7 @@ public class SOActorServiceProvider implements Actor { } // Extracted fields should not be null - if (checkExtractedFields() == false) { + if (!checkExtractedFields()) { System.err.println("some fields are missing from AAI response."); return; } @@ -338,7 +338,7 @@ public class SOActorServiceProvider implements Actor { */ public SORequest constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation, Policy policy) { - if (policy.getActor().equals("SO") && policy.getRecipe().equals("VF Module Create")) { + if ("SO".equals(policy.getActor()) && "VF Module Create".equals(policy.getRecipe())) { // perform named query request and handle response AaiNamedQueryRequest(onset); } else { @@ -348,7 +348,7 @@ public class SOActorServiceProvider implements Actor { // check if the fields extracted from named query response are // not null so we can proceed with SO request - if (checkExtractedFields() == false) { + if (!checkExtractedFields()) { System.err.println("AAI response is missing some required fields. Cannot proceed with SO Request construction."); return null; @@ -553,7 +553,7 @@ public class SOActorServiceProvider implements Actor { } /** - * @param serviceItemModeInvariantlId the serviceItemModelInvariantId to set + * @param serviceItemModelInvariantId the serviceItemModelInvariantId to set */ private void setServiceItemModelInvariantId(String serviceItemModelInvariantId) { this.serviceItemModelInvariantId = serviceItemModelInvariantId; |