From a0e0c7840f72392152a970d88a5a66d394c4a793 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Fri, 28 Sep 2018 04:58:26 -0400 Subject: Set drools-pdp checkstyle config Fixed last remaining checkstyle issues along with setting the pom.xml to the correct path setting. Fixed forbidden summary fragments, not allowed to prepend summary with "This method returns" Issue-ID: POLICY-1153 Change-Id: I267842080494132a7b5507731e14f027a3f6fe44 Signed-off-by: Pamela Dragosh --- .../checkstyle-suppressions.xml | 30 ++++++++++++++++++ feature-state-management/pom.xml | 36 ++++++++++++++++++++++ .../statemanagement/DroolsPDPIntegrityMonitor.java | 5 ++- .../IntegrityMonitorRestManager.java | 2 +- .../statemanagement/StateManagementFeature.java | 33 +++++++++++--------- 5 files changed, 87 insertions(+), 19 deletions(-) create mode 100644 feature-state-management/checkstyle-suppressions.xml (limited to 'feature-state-management') diff --git a/feature-state-management/checkstyle-suppressions.xml b/feature-state-management/checkstyle-suppressions.xml new file mode 100644 index 00000000..3c394a9c --- /dev/null +++ b/feature-state-management/checkstyle-suppressions.xml @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/feature-state-management/pom.xml b/feature-state-management/pom.xml index 4f8a9cf4..dd662f76 100644 --- a/feature-state-management/pom.xml +++ b/feature-state-management/pom.xml @@ -82,6 +82,42 @@ + + maven-checkstyle-plugin + + + onap-java-style + + check + + process-sources + + + onap-checkstyle/onap-java-style.xml + + ${project.build.sourceDirectory} + true + true + true + + + ${project.baseUri}checkstyle-suppressions.xml + true + true + warning + + + + + + org.onap.oparent + checkstyle + ${oparent.version} + compile + + + 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 3cb99f23..8dd211b4 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 @@ -83,7 +83,6 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor { * Static initialization -- create Drools Integrity Monitor, and an HTTP server to handle REST * 'test' requests. * - * @throws StateManagementPropertiesException exception * @throws IntegrityMonitorException exception */ public static DroolsPDPIntegrityMonitor init(String configDir) throws IntegrityMonitorException { @@ -134,7 +133,7 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor { // Now that we've validated the properties, create Drools Integrity Monitor // with these properties. im = makeMonitor(resourceName, stateManagementProperties); - logger.info("init: New DroolsPDPIntegrityMonitor instantiated, resourceName = ", resourceName); + logger.info("init: New DroolsPDPIntegrityMonitor instantiated, resourceName = {}", resourceName); // create http server makeRestServer(testHost, testPort, stateManagementProperties); @@ -174,7 +173,7 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor { throws IntegrityMonitorException { try { - logger.info("init: Starting HTTP server, addr= {}", testHost + ":" + testPort); + logger.info("init: Starting HTTP server, addr= {}:{}", testHost, testPort); IntegrityMonitorRestServer server = new IntegrityMonitorRestServer(); server.init(properties); diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java index 49e4577c..77c188d0 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java @@ -59,7 +59,7 @@ public class IntegrityMonitorRestManager { code = 500, message = "Integrity monitor sanity check encountered an exception. " + "This can indicate operational state disabled or administrative state locked") - }) + }) @GET @Path("test") public Response test() { diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java index d7f9d108..94f35409 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java @@ -91,7 +91,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public void addObserver(Observer stateChangeObserver) { @@ -105,7 +105,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public String getAdminState() { @@ -113,7 +113,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public String getOpState() { @@ -121,7 +121,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public String getAvailStatus() { @@ -129,7 +129,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public String getStandbyStatus() { @@ -137,7 +137,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public String getStandbyStatus(String resourceName) { @@ -145,7 +145,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public void disableFailed(String resourceName) throws Exception { @@ -154,7 +154,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public void disableFailed() throws Exception { @@ -162,7 +162,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public void promote() throws Exception { @@ -170,7 +170,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public void demote() throws Exception { @@ -178,7 +178,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. */ @Override public String getResourceName() { @@ -186,8 +186,9 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} - * @return + * {@inheritDoc}. + * + * @return true if locked or false if failed */ @Override public boolean lock() { @@ -201,7 +202,8 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. + * * @throws Exception exception */ @Override @@ -216,7 +218,8 @@ public class StateManagementFeature implements StateManagementFeatureAPI, } /** - * {@inheritDoc} + * {@inheritDoc}. + * * @throws Exception exception */ @Override -- cgit 1.2.3-korg