summaryrefslogtreecommitdiffstats
path: root/integrity-monitor
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-03-27 08:03:24 -0400
committerPamela Dragosh <pdragosh@research.att.com>2020-03-27 10:56:46 -0400
commit7da3ddfa40de2f683a2d423d62b78a8d001108eb (patch)
tree260fa9e903a3a6f2a60467bbeac500ad62d0e916 /integrity-monitor
parentdff3e8bb4ed367c05fb0425f03386994ed27d10a (diff)
More sonar issues cleanup
Either log or rethrow Use boolean expression Add at least one test Remove commented out code Issue-ID: POLICY-2204 Change-Id: I4fdf31aea75303e4f49d25198eb3b12341995bfe Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'integrity-monitor')
-rw-r--r--integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java12
-rw-r--r--integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java2
2 files changed, 6 insertions, 8 deletions
diff --git a/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java b/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
index 1372b4fc..d96aa44a 100644
--- a/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
+++ b/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
@@ -925,7 +925,7 @@ public class IntegrityMonitor {
}
// check the next group
- } // end for (String group : depGroups)
+ }
return dependencyOk;
}
@@ -963,7 +963,7 @@ public class IntegrityMonitor {
appendSeparator(errorMsg);
errorMsg.append(failMsg);
}
- } // end for (String dep : dependencies)
+ }
// if all dependencies in a group are failed, set this
// resource's state to disable dependency
@@ -1206,7 +1206,7 @@ public class IntegrityMonitor {
} catch (Exception e1) {
logger.error(EXCEPTION_STRING, e1);
}
- logger.error("writeFpc DB table commit failed with exception", e);
+ logger.error("writeFpc DB table commit failed with exception");
throw e;
}
}
@@ -1500,8 +1500,8 @@ public class IntegrityMonitor {
if (sme != null && !sme.getOpState().equals(StateManagement.DISABLED)) {
disableFailed(sme);
}
- } // end if(diffMs > staleMs)
- } // end for(ForwardProgressEntity fpe : fpList)
+ }
+ }
logger.debug("IntegrityMonitor.executeStateAudit(): exit");
}
@@ -1817,7 +1817,7 @@ public class IntegrityMonitor {
allNotWellMap = new HashMap<>();
}
- if (asw) {
+ if (Boolean.TRUE.equals(asw)) {
logger.info("allSeemsWell: ALL SEEMS WELL: key = {}, msg = {}", key, msg);
allSeemsWellMap.put(key, msg);
allNotWellMap.remove(key);
diff --git a/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java b/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java
index 7a018ef9..65ebf2d2 100644
--- a/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java
+++ b/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java
@@ -174,7 +174,6 @@ public class StateManagement {
logger.debug("StateManagement: {}() operation completed, resourceName = {}",
methodName, resourceName);
} catch (final Exception ex) {
- logger.error("StateManagement.{}() caught unexpected exception: ", methodName, ex);
throw new StateManagementException("StateManagement." + methodName + "() Exception: " + ex);
}
}
@@ -476,7 +475,6 @@ public class StateManagement {
}
} catch (final Exception ex) {
final String message = "findStateManagementEntity exception";
- logger.error("{}: {}", message, ex.toString(), ex);
throw new EntityRetrievalException(message, ex);
}
}