From 195d3d7bbed40ff1ed6659e6864a5695356a400b Mon Sep 17 00:00:00 2001 From: "halil.cakal" Date: Wed, 7 Jun 2023 11:02:30 +0100 Subject: Fix some code smells Issue-ID: CPS-1507 Change-Id: Ic11ccbb37538242cb65ab1dbdde4fc77d9f94bdf Signed-off-by: halil.cakal --- .../cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java | 6 +++--- .../java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java index 2466bc36ec..136c1d6ff4 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java @@ -54,7 +54,7 @@ public interface SubscriptionOutcomeMapper { default List mapStatusToCmHandleRejected(Map targets) { return targets.entrySet() .stream().filter(target -> SubscriptionStatus.REJECTED.equals(target.getValue())) - .map(target -> target.getKey()) + .map(Map.Entry::getKey) .collect(Collectors.toList()); } @@ -68,7 +68,7 @@ public interface SubscriptionOutcomeMapper { default List mapStatusToCmHandleAccepted(Map targets) { return targets.entrySet() .stream().filter(target -> SubscriptionStatus.ACCEPTED.equals(target.getValue())) - .map(target -> target.getKey()) + .map(Map.Entry::getKey) .collect(Collectors.toList()); } @@ -82,7 +82,7 @@ public interface SubscriptionOutcomeMapper { default List mapStatusToCmHandlePending(Map targets) { return targets.entrySet() .stream().filter(target -> SubscriptionStatus.PENDING.equals(target.getValue())) - .map(target -> target.getKey()) + .map(Map.Entry::getKey) .collect(Collectors.toList()); } } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java index 2fec59b736..1648ac4fbb 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java @@ -53,7 +53,7 @@ public class DataNodeHelper { public static List> getDataNodeLeaves(final Collection dataNodes) { return dataNodes.stream() .flatMap(DataNodeHelper::flatten) - .map(node -> node.getLeaves()) + .map(DataNode::getLeaves) .collect(Collectors.toList()); } @@ -66,10 +66,10 @@ public class DataNodeHelper { public static List> getCmHandleIdToStatus( final List> dataNodeLeaves) { return dataNodeLeaves.stream() - .map(target -> target.values()) + .map(Map::values) .filter(col -> col.contains("PENDING") - | col.contains("ACCEPTED") - | col.contains("REJECTED")) + || col.contains("ACCEPTED") + || col.contains("REJECTED")) .collect(Collectors.toList()); } } -- cgit 1.2.3-korg