aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylanB95EST <dylan.byrne@est.tech>2022-04-08 15:53:50 +0100
committerDylanB95EST <dylan.byrne@est.tech>2022-04-08 15:53:54 +0100
commitac6f54fcfd2b07a4804620bd9cfa6de6ce4e1c0c (patch)
treeecded1f31b827bb09841c831a4a4cef7551d1a9f
parentb7ad8ef3750e2d633acfb8e70255b4d4cb195430 (diff)
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 <dylan.byrne@est.tech>
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java3
-rw-r--r--cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java4
2 files changed, 4 insertions, 3 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
index e9a69b3054..105a6a559c 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
@@ -74,7 +74,8 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
private DmiPluginRegistrationErrorResponse getFailureRegistrationResponse(
final DmiPluginRegistrationResponse dmiPluginRegistrationResponse) {
- final var dmiPluginRegistrationErrorResponse = new DmiPluginRegistrationErrorResponse();
+ final DmiPluginRegistrationErrorResponse dmiPluginRegistrationErrorResponse =
+ new DmiPluginRegistrationErrorResponse();
dmiPluginRegistrationErrorResponse.setFailedCreatedCmHandles(
getFailedResponses(dmiPluginRegistrationResponse.getCreatedCmHandles()));
dmiPluginRegistrationErrorResponse.setFailedUpdatedCmHandles(
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<Object[]> resultsAsObjects =
- (List<Object[]>) entityManager.createNativeQuery(sql).getResultList();
+ @SuppressWarnings("unchecked")
+ final List<Object[]> resultsAsObjects = entityManager.createNativeQuery(sql).getResultList();
final List<ModuleReference> resultsAsModuleReferences = new ArrayList<>(resultsAsObjects.size());
for (final Object[] row : resultsAsObjects) {