diff options
author | Sourabh Sourabh <sourabh.sourabh@est.tech> | 2023-08-17 08:37:47 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-08-17 08:37:47 +0000 |
commit | a52b1825f99318181cd356dcde1b1db46c1098ac (patch) | |
tree | deb2fba3e361bc721aa383b423f71dcdf534fa63 | |
parent | 0373f194c665e21fcc73babdad3da66a691251a1 (diff) | |
parent | 0fc90001599fed1727297da44b3c5d4fe1f1be43 (diff) |
Merge "Fixing sonar issues"
3 files changed, 3 insertions, 6 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java index 56fbe8cceb..c3b8adb5dd 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java @@ -329,7 +329,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService final List<Long> anchorIds; if (paginationOption == NO_PAGINATION) { - anchorIds = Collections.EMPTY_LIST; + anchorIds = Collections.emptyList(); } else { anchorIds = getAnchorIdsForPagination(dataspaceEntity, cpsPathQuery, paginationOption); if (anchorIds.isEmpty()) { diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java index 136512077c..9d0b7ee0d6 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java @@ -337,10 +337,7 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ .filter(entity -> StringUtils.equals(checksum, (entity.getChecksum()))) .findFirst() .map(YangResourceEntity::getFileName); - if (optionalFileName.isPresent()) { - return optionalFileName.get(); - } - return "no filename"; + return optionalFileName.orElse("no filename"); } private String getDuplicatedChecksumFromException(final ConstraintViolationException exception) { diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java index 0c43d62bc7..472ed409aa 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java @@ -60,7 +60,7 @@ public class FragmentQueryBuilder { */ public Query getQueryForAnchorAndCpsPath(final AnchorEntity anchorEntity, final CpsPathQuery cpsPathQuery) { return getQueryForDataspaceOrAnchorAndCpsPath(anchorEntity.getDataspace(), - anchorEntity, cpsPathQuery, Collections.EMPTY_LIST); + anchorEntity, cpsPathQuery, Collections.emptyList()); } /** |