diff options
author | Jim Hahn <jrh3@att.com> | 2021-06-21 09:54:27 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-06-21 10:10:44 -0400 |
commit | 9e01b2e7180f61d8a57e55fed6a2fa5619f9f947 (patch) | |
tree | 51a4303f7bef96b4c3c08e0c90dd05ba1f69a84f /models-dao/src/main | |
parent | 2da98d086aafdcb997c1aab23bd9fff6d9b65626 (diff) |
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 <jrh3@att.com>
Diffstat (limited to 'models-dao/src/main')
-rw-r--r-- | models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java | 15 |
1 files changed, 8 insertions, 7 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 extends PfConcept> T getSingleResult(final Class<T> someClass, final String searchFilter, List<T> ret) { - if (ret == null || ret.isEmpty()) { + private <T extends PfConcept> T getSingleResult(final Class<T> someClass, final String searchFilter, + List<T> 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 <T> 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 extends PfConcept> T checkAndReturn(final Class<T> someClass, final T objToCheck) { |