From 5a366fdab88b7205cedd2ba687109b80dc374544 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 10 Dec 2019 13:57:32 +0000 Subject: Fix minor checksyle issues in models New checkstyle profile flagged some minor issues in policy models. Issue-ID: POLICY-2165 Change-Id: I17ed070a3d55601ad31e48fdfd29fff01d29fa42 Signed-off-by: liamfallon --- .../java/org/onap/policy/models/base/PfConcept.java | 19 ++++++++++--------- .../org/onap/policy/models/base/PfModelService.java | 17 +++++++++-------- .../policy/models/base/PfModelExceptionInfoTest.java | 5 +++-- .../policy/models/base/testconcepts/DummyPfKey.java | 4 +++- 4 files changed, 25 insertions(+), 20 deletions(-) (limited to 'models-base') diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfConcept.java b/models-base/src/main/java/org/onap/policy/models/base/PfConcept.java index a1cfac4ae..c77c68fd5 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfConcept.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfConcept.java @@ -27,8 +27,8 @@ import java.util.List; import lombok.NonNull; /** - * This class is the base class for all Policy Framework concept classes. It enforces implementation - * of abstract methods and interfaces on all concepts that are sub-classes of this class. + * This class is the base class for all Policy Framework concept classes. It enforces implementation of abstract methods + * and interfaces on all concepts that are sub-classes of this class. */ public abstract class PfConcept implements Serializable, Comparable { @@ -37,7 +37,9 @@ public abstract class PfConcept implements Serializable, Comparable { /** * Default constructor. */ - public PfConcept() {} + public PfConcept() { + // Default Constructor + } /** * Copy constructor. @@ -56,8 +58,8 @@ public abstract class PfConcept implements Serializable, Comparable { public abstract PfKey getKey(); /** - * Gets a list of all keys for this concept and all concepts that are defined or referenced by - * this concept and its sub-concepts. + * Gets a list of all keys for this concept and all concepts that are defined or referenced by this concept and its + * sub-concepts. * * @return the keys used by this concept and its contained concepts */ @@ -67,14 +69,13 @@ public abstract class PfConcept implements Serializable, Comparable { * Validate that this concept is structurally correct. * * @param result the parameter in which the result of the validation will be returned - * @return the validation result that was passed in in the @{link result} field with the result - * of this validation added + * @return the validation result that was passed in in the @{link result} field with the result of this validation + * added */ public abstract PfValidationResult validate(@NonNull final PfValidationResult result); /** - * Clean this concept, tidy up any superfluous information such as leading and trailing white - * space. + * Clean this concept, tidy up any superfluous information such as leading and trailing white space. */ public abstract void clean(); diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfModelService.java b/models-base/src/main/java/org/onap/policy/models/base/PfModelService.java index 67ba59c8b..134b6213e 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfModelService.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfModelService.java @@ -30,14 +30,13 @@ import lombok.NonNull; /** * The model service makes Policy Framework models available to all classes in a JVM. * - *

The reason for having a model service is to avoid having to pass concept and model definitions - * down long call chains in modules such as the Policy Framework engine and editor. The model - * service makes the model and concept definitions available statically. + *

The reason for having a model service is to avoid having to pass concept and model definitions down long call + * chains in modules such as the Policy Framework engine and editor. The model service makes the model and concept + * definitions available statically. * - *

Note that the use of the model service means that only a single Policy Framework model of a - * particular type may exist in Policy Framework (particularly the engine) at any time. Of course - * the model in a JVM can be changed at any time provided all users of the model are stopped and - * restarted in an orderly manner. + *

Note that the use of the model service means that only a single Policy Framework model of a particular type may + * exist in Policy Framework (particularly the engine) at any time. Of course the model in a JVM can be changed at any + * time provided all users of the model are stopped and restarted in an orderly manner. */ public abstract class PfModelService { // The map holding the models @@ -46,7 +45,9 @@ public abstract class PfModelService { /** * This class is an abstract static class that cannot be extended. */ - private PfModelService() {} + private PfModelService() { + // Default constructor + } /** * Register a model with the model service. diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfModelExceptionInfoTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfModelExceptionInfoTest.java index 183b44c13..b418234c7 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/PfModelExceptionInfoTest.java +++ b/models-base/src/test/java/org/onap/policy/models/base/PfModelExceptionInfoTest.java @@ -33,11 +33,12 @@ import org.onap.policy.models.errors.concepts.ErrorResponseInfo; * @author Liam Fallon (liam.fallon@est.tech) */ public class PfModelExceptionInfoTest { + @Test - public void exceptionInfoTest() { + public void testExceptionInfo() { try { throw new PfModelException(Response.Status.ACCEPTED, "HELLO"); - } catch (PfModelException pfme) { + } catch (PfModelException pfme) { String errorMessage = getErrorMessage(pfme); assertEquals("Server returned: Accepted", errorMessage.substring(0, 25)); } diff --git a/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java b/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java index 058ef37c3..ed2fb9885 100644 --- a/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java +++ b/models-base/src/test/java/org/onap/policy/models/base/testconcepts/DummyPfKey.java @@ -33,7 +33,9 @@ import org.onap.policy.models.base.PfValidationResult; public class DummyPfKey extends PfKey { private static final long serialVersionUID = 1L; - public DummyPfKey() { } + public DummyPfKey() { + // Default constructor + } public DummyPfKey(DummyPfKey source) { super(source); -- cgit 1.2.3-korg