From 61b27e147b5d8d816488b3a5a5dc1d57a1539186 Mon Sep 17 00:00:00 2001 From: jhh Date: Mon, 10 May 2021 17:13:57 -0500 Subject: interrupted exception and var usage sonars Issue-ID: POLICY-3230 Signed-off-by: jhh Change-Id: I50a4ee81f0a1c97df25732a4e4507e8b7f8c8e4d --- .../statemanagement/DroolsPdpIntegrityMonitor.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'feature-state-management') diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java index 680abf3f..09dd275e 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * feature-state-management + * ONAP * ================================================================================ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -47,7 +47,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor { private static DroolsPdpIntegrityMonitor im = null; // list of audits to run - private static AuditBase[] audits = new AuditBase[] {DbAudit.getInstance(), RepositoryAudit.getInstance()}; + private static final AuditBase[] audits = new AuditBase[] {DbAudit.getInstance(), RepositoryAudit.getInstance()}; private static Properties subsystemTestProperties = null; @@ -57,8 +57,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor { * Constructor - pass arguments to superclass, but remember properties. * * @param resourceName unique name of this Integrity Monitor - * @param url the JMX URL of the MBean server - * @param properties properties used locally, as well as by 'IntegrityMonitor' + * @param consolidatedProperties properties used locally, as well as by 'IntegrityMonitor' * @throws IntegrityMonitorException (passed from superclass) */ private DroolsPdpIntegrityMonitor(String resourceName, Properties consolidatedProperties) @@ -87,7 +86,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor { logger.info("init: Entering and invoking PropertyUtil.getProperties() on '{}'", configDir); // read in properties - Properties stateManagementProperties = getProperties(configDir); + var stateManagementProperties = getProperties(configDir); // fetch and verify definitions of some properties, adding defaults where // appropriate @@ -241,7 +240,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor { * * @param props set of properties * @param name name of the property to check - * @param expected expected/default value + * @param dflt expected/default value */ private static void addDefaultPropWarn(Properties props, String name, String dflt) { String val = props.getProperty(name); @@ -282,7 +281,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor { } // will contain list of subsystems where the audit failed - String responseMsg = ""; + var responseMsg = ""; // Loop through all of the audits, and see which ones have failed. // NOTE: response information is stored within the audit objects @@ -354,7 +353,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor { * Abstract method to invoke the audit. * * @param persistenceProperties Used for DB access - * @throws Exception passed in by the audit + * @throws IntegrityMonitorException passed in by the audit */ abstract void invoke(Properties persistenceProperties) throws IntegrityMonitorException; } @@ -392,6 +391,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor { server.waitedStart(5); } catch (Exception e) { logger.error("Exception waiting for servers to start: ", e); + Thread.currentThread().interrupt(); } } -- cgit 1.2.3-korg