aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-04-29 11:43:05 -0400
committerJim Hahn <jrh3@att.com>2019-04-29 12:24:15 -0400
commit119fc53d7272184333b0a90fc911b988bc25d5a1 (patch)
tree9ad07e0f17eb87c0bd74b7d83c34cbb26b45a582 /utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java
parent5c0b134f3054415a10516732efff1f958e649c43 (diff)
Fix sonar issue with double compare4.0.0-ONAP1.4.0
The gson code to convert Double to Long/Integer use a direct comparison of the original double with a long. However, sonar does not like that so changed the code to use the Double.compare() method instead. Also fixed sonar issue with diamond operator. Addressed some sonar issues in ServiceManager. Addressed some sonar issues in Version. Change-Id: I0959603918d251db671e87e12c295c6ec911f427 Issue-ID: POLICY-1707 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java')
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java b/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java
index 13cd6de8..5c8c01df 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java
@@ -98,7 +98,7 @@ public class ServiceManager implements Startable {
throw new IllegalStateException(name + " is already running; cannot add " + stepName);
}
- items.add(new Service(stepName, () -> service.start(), () -> service.stop()));
+ items.add(new Service(stepName, service::start, service::stop));
return this;
}
@@ -173,7 +173,7 @@ public class ServiceManager implements Startable {
* @param running services that are running, in the order they were started
* @throws ServiceManagerException if a service fails to stop
*/
- private void rewind(Deque<Service> running) throws ServiceManagerException {
+ private void rewind(Deque<Service> running) {
Exception ex = null;
logger.info("{} stopping", name);