From 9e01b2e7180f61d8a57e55fed6a2fa5619f9f947 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 21 Jun 2021 09:54:27 -0400 Subject: Fix new checkstyle issues in models The new version of checkstyle identified new issues. Fixed those. Issue-ID: POLICY-3094 Change-Id: I85314bc0249cba0020a0aefbc250851a2b646dd9 Signed-off-by: Jim Hahn --- .../org/onap/policy/models/dao/impl/DefaultPfDao.java | 15 ++++++++------- .../controlloop/actor/appclcm/AppcLcmOperation.java | 2 +- .../impl/BidirectionalTopicOperation.java | 3 +-- .../actorserviceprovider/impl/HttpOperation.java | 2 +- .../actorserviceprovider/impl/OperationPartial.java | 1 - .../actorserviceprovider/impl/HttpOperationTest.java | 3 --- .../onap/policy/models/pdp/concepts/PdpGroupFilter.java | 2 +- .../models/pdp/persistence/provider/PdpProvider.java | 2 +- .../tosca/simple/concepts/JpaToscaServiceTemplate.java | 1 - 9 files changed, 13 insertions(+), 18 deletions(-) diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java index 16680d800..e9a10a134 100644 --- a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java +++ b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java @@ -648,19 +648,20 @@ public class DefaultPfDao implements PfDao { * Check that a query returned one and only one entry and return that entry. * * @param someClass the class being searched for - * @param conceptName the concept name being searched for + * @param searchFilter the search filter * @param resultList the result list returned by the query * @return the single unique result */ - private T getSingleResult(final Class someClass, final String searchFilter, List ret) { - if (ret == null || ret.isEmpty()) { + private T getSingleResult(final Class someClass, final String searchFilter, + List resultList) { + if (resultList == null || resultList.isEmpty()) { return null; } - if (ret.size() > 1) { + if (resultList.size() > 1) { throw new IllegalArgumentException("More than one result was returned query on " + someClass - + " with filter " + searchFilter + ": " + ret); + + " with filter " + searchFilter + ": " + resultList); } - return ret.get(0); + return resultList.get(0); } /** @@ -668,7 +669,7 @@ public class DefaultPfDao implements PfDao { * * @param the type of the object to get, a subclass of {@link PfConcept} * @param someClass the class of the object to get, a subclass of {@link PfConcept} - * @param t the object that was retrieved from the database + * @param objToCheck the object that was retrieved from the database * @return the checked object or null */ private T checkAndReturn(final Class someClass, final T objToCheck) { diff --git a/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java b/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java index c3aae6879..5d256e8ae 100644 --- a/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java +++ b/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmOperation.java @@ -119,7 +119,7 @@ public class AppcLcmOperation extends BidirectionalTopicOperation source, AppcLcmInput request) { try { diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java index c4d5cca33..5765f35ba 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java @@ -177,9 +177,8 @@ public abstract class BidirectionalTopicOperation extends OperationPartial /** * Processes a response. * - * @param infra communication infrastructure on which the response was received * @param outcome outcome to be populated - * @param response raw response to process + * @param rawResponse raw response to process * @param scoResponse response, as a {@link StandardCoderObject} * @return the outcome, or {@code null} if still waiting for completion */ diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java index 4812e7739..047e3d1c8 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java @@ -214,7 +214,7 @@ public abstract class HttpOperation extends OperationPartial { * * @param outcome outcome to be populate * @param url URL to which to request was sent - * @param response raw response to process + * @param rawResponse raw response to process * @return a future to cancel or await the outcome */ protected CompletableFuture processResponse(OperationOutcome outcome, String url, diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java index 5fbf7d2df..4f2ab0267 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java @@ -217,7 +217,6 @@ public abstract class OperationPartial implements Operation { /** * Starts the operation attempt, without doing any retries. * - * @param params operation parameters * @param attempt attempt number, typically starting with 1 * @return a future that will return the result of a single operation attempt */ diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperationTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperationTest.java index 117b4097b..553fd1726 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperationTest.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperationTest.java @@ -437,7 +437,6 @@ public class HttpOperationTest { /** * Initializes the configuration. * - * @param operator operator to be initialized * @param clientName name of the client which it should use */ private void initConfig(String clientName) { @@ -447,7 +446,6 @@ public class HttpOperationTest { /** * Initializes the configuration with a real client. * - * @param operator operator to be initialized * @param clientName name of the client which it should use */ private void initConfig(String clientName, HttpClientFactory factory) { @@ -458,7 +456,6 @@ public class HttpOperationTest { /** * Initializes the configuration with a real client. * - * @param operator operator to be initialized * @param clientName name of the client which it should use */ private void initRealConfig(String clientName) { diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroupFilter.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroupFilter.java index ad64deb21..5373ace1d 100644 --- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroupFilter.java +++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpGroupFilter.java @@ -186,7 +186,7 @@ public class PdpGroupFilter implements PfObjectFilter { * Filter PDP groups on PDP state. * * @param pdpGroup the PDP group to check - * @param policyFilter the policy regular expressions to check for + * @param pdpState the PDP state of interest * @return true if the filter should let this PDP group through */ private boolean filterOnPdpState(final PdpGroup pdpGroup, final PdpState pdpState) { diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpProvider.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpProvider.java index fec8ec572..681e39e71 100644 --- a/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpProvider.java +++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/persistence/provider/PdpProvider.java @@ -358,7 +358,7 @@ public class PdpProvider { /** * Convert JPA PDP group list to an authorative PDP group list. * - * @param foundPdpGroups the list to convert + * @param jpaPdpGroupList the list to convert * @return the authorative list */ private List asPdpGroupList(List jpaPdpGroupList) { diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java index 902437447..769b623c7 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplate.java @@ -417,7 +417,6 @@ public class JpaToscaServiceTemplate extends JpaToscaEntityType