Fix sonar qube violations 02/122602/2
authorniamhcore <niamh.core@est.tech>
Tue, 13 Jul 2021 14:24:29 +0000 (15:24 +0100)
committerniamhcore <niamh.core@est.tech>
Tue, 13 Jul 2021 14:44:52 +0000 (15:44 +0100)
Issue-ID: CPS-475
Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: If55140bbf3e5b28e8e9334838d1a81b74619c99d

cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java

index 972807b..1b3dc24 100755 (executable)
@@ -29,7 +29,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
-import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import javax.transaction.Transactional;
@@ -186,7 +185,7 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ
      */
     private String getDuplicatedChecksumFromException(final ConstraintViolationException exception) {
         String checksum = null;
-        final Matcher matcher = CHECKSUM_EXCEPTION_PATTERN.matcher(exception.getSQLException().getMessage());
+        final var matcher = CHECKSUM_EXCEPTION_PATTERN.matcher(exception.getSQLException().getMessage());
         if (matcher.find() && matcher.groupCount() == 1) {
             checksum = matcher.group(1);
         }