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 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'models-dao') 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) { -- cgit 1.2.3-korg