From a45f8909871dc1ddb75845f067a602951afc8d11 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 19 Feb 2018 16:56:06 -0500 Subject: Sonar fixes to drools-pdp Fixed most of the instances of the following sonar issues: Moved array designator Used diamond operator Changed System.out/err to use a logger Changed several Thread.sleep() in test code to a single sleep() Useless assignments Replaced comparison with "" to string.isEmpty() Merged if's Replaced ArrayList with List in method returns Reordered type modifiers Reordered constructor methods Defined constants for literals, or replaced them with method calls Removed "throws Xxx" for subclasses of RuntimeException Combined identical "catch" blocks Re-interrupted the current thread after catching an InterruptedException Removed tests against the literal "false" Fix indentation of new makeTopicOperError() method. Fix exception variable name in new methods, logNoUebEncoder() and logNoDmaapEncoder(). Change-Id: Iddae5210553662f733b67333b372dec8c3fe2c94 Issue-ID: POLICY-336 Signed-off-by: Jim Hahn --- .../policy/drools/healthcheck/HealthCheck.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'feature-healthcheck/src/main/java/org/onap') diff --git a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java index bdb15a70..8fa6dfab 100644 --- a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java +++ b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * feature-healthcheck * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,11 @@ import org.slf4j.LoggerFactory; * Healthcheck */ public interface HealthCheck extends Startable { + + /** + * Healthcheck Monitor + */ + public static final HealthCheck monitor = new HealthCheckMonitor(); /** * Healthcheck Report @@ -156,7 +161,7 @@ public interface HealthCheck extends Startable { return details; } - public void setDetails(ArrayList details) { + public void setDetails(List details) { this.details = details; } } @@ -166,11 +171,6 @@ public interface HealthCheck extends Startable { * @return a report */ public Reports healthCheck(); - - /** - * Healthcheck Monitor - */ - public static final HealthCheck monitor = new HealthCheckMonitor(); } /** @@ -243,7 +243,7 @@ class HealthCheckMonitor implements HealthCheck { * {@inheritDoc} */ @Override - public boolean start() throws IllegalStateException { + public boolean start() { try { this.healthCheckProperties = SystemPersistence.manager.getProperties(HealthCheckFeature.CONFIGURATION_PROPERTIES_NAME); @@ -265,7 +265,7 @@ class HealthCheckMonitor implements HealthCheck { * {@inheritDoc} */ @Override - public boolean stop() throws IllegalStateException { + public boolean stop() { for (HttpServletServer server : servers) { try { @@ -290,7 +290,7 @@ class HealthCheckMonitor implements HealthCheck { * {@inheritDoc} */ @Override - public void shutdown() throws IllegalStateException { + public void shutdown() { this.stop(); } -- cgit 1.2.3-korg