From ea7d1b448699d890d15fd37c69d4705a094a1b53 Mon Sep 17 00:00:00 2001 From: emaclee Date: Sun, 24 Mar 2024 19:05:34 +0000 Subject: Uplift Spring boot 3.2.4 - uplifted spring boot from 3.1.2 to 3.2.4 - removed redundant dependencies - upgraded relevant dependencies - use of @Bean(some_name) is give a specific bean name - using @Bean(some_name) with @Qualifier so on the injection point to specify which bean to actually inject, this is used as we deal with multiple beans of the same type. Issue-ID: CPS-2101 Change-Id: I64d5bf567b9eb03fb39034a46528d0160b332715 Signed-off-by: emaclee --- cps-ri/pom.xml | 10 ++-------- .../org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java | 5 +++-- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'cps-ri') diff --git a/cps-ri/pom.xml b/cps-ri/pom.xml index a6e1e10e45..dad9548f32 100644 --- a/cps-ri/pom.xml +++ b/cps-ri/pom.xml @@ -3,7 +3,7 @@ ============LICENSE_START======================================================= Copyright (C) 2020-2021 Pantheon.tech Modifications Copyright (C) 2020-2021 Bell Canada - Modifications Copyright (C) 2020-2023 Nordix Foundation + Modifications Copyright (C) 2020-2024 Nordix Foundation ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ io.hypersistence - hypersistence-utils-hibernate-60 + hypersistence-utils-hibernate-63 org.projectlombok @@ -118,12 +118,6 @@ org.springframework.boot spring-boot-starter-test test - - - org.junit.vintage - junit-vintage-engine - - 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 b0f9a2da52..17f13b81ad 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 @@ -69,6 +69,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException; import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangModelDependencyInfo; import org.springframework.dao.DataIntegrityViolationException; +import org.springframework.retry.RetryContext; import org.springframework.retry.annotation.Backoff; import org.springframework.retry.annotation.Retryable; import org.springframework.retry.support.RetrySynchronizationManager; @@ -277,8 +278,8 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ dataIntegrityViolationException, newYangResourceEntities); convertedException.ifPresent( e -> { - int retryCount = RetrySynchronizationManager.getContext() == null ? 0 - : RetrySynchronizationManager.getContext().getRetryCount(); + final RetryContext retryContext = RetrySynchronizationManager.getContext(); + int retryCount = retryContext == null ? 0 : retryContext.getRetryCount(); log.warn("Cannot persist duplicated yang resource. System will attempt this method " + "up to 5 times. Current retry count : {}", ++retryCount, e); }); -- cgit 1.2.3-korg