From 6505fa1c845c34d59c44a40f87b66ef79f3e911c Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Tue, 14 Aug 2018 09:45:44 -0400 Subject: Fixes for checkstyle issues More fixes for spacing, adding comments, adding period at the end, and move code closer to usage. Issue-ID: POLICY-881 Change-Id: Ife99eaf627a221e87d65d24dfd145b0ee4e06d21 Signed-off-by: Pamela Dragosh --- .../org/onap/policy/common/ia/AuditThread.java | 4 +-- .../org/onap/policy/common/ia/AuditorTime.java | 4 ++- .../org/onap/policy/common/ia/IntegrityAudit.java | 15 ++++---- .../src/main/resources/META-INF/persistence.xml | 41 ++++++++++++---------- 4 files changed, 36 insertions(+), 28 deletions(-) (limited to 'integrity-audit/src/main') diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java index dc396a07..177391c3 100644 --- a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java +++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditThread.java @@ -709,7 +709,7 @@ public class AuditThread extends Thread { * Indicates that the {@link #run()} method has started. This method simply returns, * and may overridden by junit tests. * - * @throws InterruptedException + * @throws InterruptedException can be interrupted */ public void runStarted() throws InterruptedException { // does nothing @@ -719,7 +719,7 @@ public class AuditThread extends Thread { * Indicates that an audit has completed. This method simply returns, and may * overridden by junit tests. * - * @throws InterruptedException + * @throws InterruptedException can be interrupted */ public void auditCompleted() throws InterruptedException { // does nothing diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditorTime.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditorTime.java index 9cff742c..95eecbc3 100644 --- a/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditorTime.java +++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/AuditorTime.java @@ -41,13 +41,15 @@ public class AuditorTime { private static Supplier supplier = () -> currentTime; /** - * + * Constructor. */ private AuditorTime() { super(); } /** + * Get instance. + * * @return the CurrentTime singleton */ public static CurrentTime getInstance() { diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java index 4d15205a..d50c7059 100644 --- a/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java +++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/IntegrityAudit.java @@ -206,8 +206,10 @@ public class IntegrityAudit { logger.info("startAuditThread: Entering"); if (integrityAuditPeriodSeconds >= 0) { - this.auditThread = makeAuditThread(this.resourceName, this.persistenceUnit, this.properties, integrityAuditPeriodSeconds); - logger.info("startAuditThread: Audit started and will run every " + integrityAuditPeriodSeconds + " seconds"); + this.auditThread = makeAuditThread(this.resourceName, this.persistenceUnit, + this.properties, integrityAuditPeriodSeconds); + logger.info("startAuditThread: Audit started and will run every " + integrityAuditPeriodSeconds + + " seconds"); this.auditThread.start(); } else { @@ -269,6 +271,7 @@ public class IntegrityAudit { } /** + * Return if audit thread. * * @return {@code true} if an audit thread exists, {@code false} otherwise */ @@ -279,13 +282,13 @@ public class IntegrityAudit { /** * Creates an audit thread. May be overridden by junit tests. * - * @param resourceName2 - * @param persistenceUnit2 - * @param properties2 + * @param resourceName2 the resource name + * @param persistenceUnit2 the persistence unit + * @param properties2 properties * @param integrityAuditPeriodSeconds2 * * @return a new audit thread - * @throws IntegrityAuditException + * @throws IntegrityAuditException audit exception */ protected AuditThread makeAuditThread(String resourceName2, String persistenceUnit2, Properties properties2, int integrityAuditPeriodSeconds2) throws IntegrityAuditException { diff --git a/integrity-audit/src/main/resources/META-INF/persistence.xml b/integrity-audit/src/main/resources/META-INF/persistence.xml index 2f435618..33c701b1 100644 --- a/integrity-audit/src/main/resources/META-INF/persistence.xml +++ b/integrity-audit/src/main/resources/META-INF/persistence.xml @@ -20,24 +20,27 @@ --> - - - org.eclipse.persistence.jpa.PersistenceProvider - org.onap.policy.common.ia.jpa.IntegrityAuditEntity - org.onap.policy.common.ia.jpa.IaTestEntity - NONE - - - - + + + org.eclipse.persistence.jpa.PersistenceProvider + org.onap.policy.common.ia.jpa.IntegrityAuditEntity + org.onap.policy.common.ia.jpa.IaTestEntity + NONE + + + + - - - org.eclipse.persistence.jpa.PersistenceProvider - org.onap.policy.common.ia.jpa.IntegrityAuditEntity - NONE - - - - + + + org.eclipse.persistence.jpa.PersistenceProvider + org.onap.policy.common.ia.jpa.IntegrityAuditEntity + NONE + + + + -- cgit 1.2.3-korg