diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-03-20 17:28:29 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-03-21 14:29:10 +0000 |
commit | 5c205833e4b2e8f6cfe938641cdbceaf680da92b (patch) | |
tree | e36d7973d7571d87bad00bb59e68d21d3ab6e26e /feature-state-management/src/main/java | |
parent | 0f981f6ceee254df09688b451bd32a2da6d1a700 (diff) |
Fix bugs identified by Sonar on drools-pdp
Three bugs fixed:
1. Set of static variable in DMaaPSimulatorJaxR
2. Use of opssibly null variable "output" in RepositoryAudit
3. Unreachable statement error in RepositoryAudit
Change-Id: I72e028cfc51a82250afd02fb4109d3dea08072dc
Issue-ID: POLICY-691
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'feature-state-management/src/main/java')
2 files changed, 6 insertions, 5 deletions
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java index 11134443..6ddf0c78 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java @@ -330,7 +330,7 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase * Note: at present, this step just generates log messages, * but doesn't do any verification. */ - if (rval == 0) + if (rval == 0 && output != null) { // place output in 'fileContents' (replacing the Return characters // with Newline) diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java index 3cc27907..cb1700e4 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java @@ -84,12 +84,13 @@ public class StateManagementFeature implements StateManagementFeatureAPI, droolsPdpIntegrityMonitor = DroolsPDPIntegrityMonitor.getInstance(); stateManagement = droolsPdpIntegrityMonitor.getStateManager(); - logger.debug("StateManagementFeature.globalInit(): " - + "stateManagement.getAdminState(): {}", stateManagement.getAdminState()); - - if(stateManagement == null){ + if (stateManagement == null) { logger.debug("StateManagementFeature.globalInit(): stateManagement is NULL!"); } + else { + logger.debug("StateManagementFeature.globalInit(): " + + "stateManagement.getAdminState(): {}", stateManagement.getAdminState()); + } } catch (Exception e1) { logger.debug("StateManagementFeature.globalInit(): DroolsPDPIntegrityMonitor" + " initialization failed with exception:", e1); |