diff options
Diffstat (limited to 'cps-ri/src/main')
-rw-r--r-- | cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java | 3 | ||||
-rwxr-xr-x | cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java | 6 |
2 files changed, 4 insertions, 5 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 fdb01485ad..02f723029d 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 @@ -692,8 +692,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService private String mergeLeaves(final Map<String, Serializable> updateLeaves, final String currentLeavesAsString) { Map<String, Serializable> currentLeavesAsMap = new HashMap<>(); if (currentLeavesAsString != null) { - currentLeavesAsMap = currentLeavesAsString.isEmpty() - ? new HashMap<>() : jsonObjectMapper.convertJsonString(currentLeavesAsString, Map.class); + currentLeavesAsMap = jsonObjectMapper.convertJsonString(currentLeavesAsString, Map.class); currentLeavesAsMap.putAll(updateLeaves); } 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 e149a1f149..136512077c 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 @@ -340,15 +340,15 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ if (optionalFileName.isPresent()) { return optionalFileName.get(); } - return null; + return "no filename"; } private String getDuplicatedChecksumFromException(final ConstraintViolationException exception) { final Matcher matcher = CHECKSUM_EXCEPTION_PATTERN.matcher(exception.getSQLException().getMessage()); - if (matcher.find() && matcher.groupCount() == 1) { + if (matcher.find()) { return matcher.group(1); } - return null; + return "no checksum found"; } private static ModuleReference toModuleReference( |