From ac6f54fcfd2b07a4804620bd9cfa6de6ce4e1c0c Mon Sep 17 00:00:00 2001 From: DylanB95EST Date: Fri, 8 Apr 2022 15:53:50 +0100 Subject: Fix Sonar Qube Violations - Recurring task Fix sonar issues in CPS. - Remove Unnecessary cast to List - Immediately return expession Issue-ID: CPS-475 Change-Id: Ic3fa2f3f92784682045a780d87c6737d04f37659 Signed-off-by: DylanB95EST --- .../org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cps-ri/src/main/java') diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java index 40a93da71c..f85dea3a73 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java @@ -155,8 +155,8 @@ public class ModuleReferenceRepositoryImpl implements ModuleReferenceQuery { + " AND yang_resource.revision=%1$s.revision" + " WHERE yang_resource.module_name IS NULL;", tempTableName); - final List resultsAsObjects = - (List) entityManager.createNativeQuery(sql).getResultList(); + @SuppressWarnings("unchecked") + final List resultsAsObjects = entityManager.createNativeQuery(sql).getResultList(); final List resultsAsModuleReferences = new ArrayList<>(resultsAsObjects.size()); for (final Object[] row : resultsAsObjects) { -- cgit 1.2.3-korg