From ebba970be8756e8b25e0be323a7c251a3f989ecf Mon Sep 17 00:00:00 2001 From: "halil.cakal" Date: Fri, 13 Sep 2024 13:52:57 +0100 Subject: Fix violation reported by sonarqube Issue-ID: CPS-89 Change-Id: Ia6e3bb26ffb433f3610f53f408fad12489f2e3b3 Signed-off-by: halil.cakal --- .../java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java | 2 +- .../main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'cps-ncmp-service/src') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java index 42123f1a26..13cde86b6e 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java @@ -208,7 +208,7 @@ public class InventoryPersistenceImpl extends NcmpPersistenceImpl implements Inv @Override public boolean isExistingCmHandleId(final String cmHandleId) { try { - return getCmHandleDataNodeByCmHandleId(cmHandleId).size() > 0; + return !getCmHandleDataNodeByCmHandleId(cmHandleId).isEmpty(); } catch (final DataNodeNotFoundException exception) { return false; } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java index 06269d5177..2a9717cc1a 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java @@ -29,7 +29,6 @@ import org.onap.cps.events.EventsPublisher; import org.onap.cps.ncmp.events.avc.ncmp_to_client.Avc; import org.onap.cps.ncmp.events.avc.ncmp_to_client.AvcEvent; import org.onap.cps.ncmp.events.avc.ncmp_to_client.Data; -import org.onap.cps.ncmp.utils.events.NcmpEvent; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -- cgit 1.2.3-korg