diff options
Diffstat (limited to 'cps-ri/src')
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()); } /** |