aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhalil.cakal <halil.cakal@est.tech>2023-06-07 11:02:30 +0100
committerhalil.cakal <halil.cakal@est.tech>2023-06-07 11:02:50 +0100
commit195d3d7bbed40ff1ed6659e6864a5695356a400b (patch)
treefddd68d3f5ee65974fcf93c2860b39ad503358c3
parentc7e243ad790ae0bf3957a486a59d81374ba89075 (diff)
Fix some code smells
Issue-ID: CPS-1507 Change-Id: Ic11ccbb37538242cb65ab1dbdde4fc77d9f94bdf Signed-off-by: halil.cakal <halil.cakal@est.tech>
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionOutcomeMapper.java6
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/DataNodeHelper.java8
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<Object> mapStatusToCmHandleRejected(Map<String, SubscriptionStatus> 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<Object> mapStatusToCmHandleAccepted(Map<String, SubscriptionStatus> 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<Object> mapStatusToCmHandlePending(Map<String, SubscriptionStatus> 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<Map<String, Serializable>> getDataNodeLeaves(final Collection<DataNode> 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<Collection<Serializable>> getCmHandleIdToStatus(
final List<Map<String, Serializable>> 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());
}
}