summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhalil.cakal <halil.cakal@est.tech>2024-09-13 13:52:57 +0100
committerhalil.cakal <halil.cakal@est.tech>2024-09-13 13:57:19 +0100
commitebba970be8756e8b25e0be323a7c251a3f989ecf (patch)
tree51890a9b7e13fc8ed50ba6898354047cae0e9a72
parentfc49910404bf3868788e4b8d91d93047ce297f4d (diff)
Fix violation reported by sonarqube
Issue-ID: CPS-89 Change-Id: Ia6e3bb26ffb433f3610f53f408fad12489f2e3b3 Signed-off-by: halil.cakal <halil.cakal@est.tech>
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/inventory/InventoryPersistenceImpl.java2
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/utils/events/CmAvcEventPublisher.java1
2 files changed, 1 insertions, 2 deletions
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;