summaryrefslogtreecommitdiffstats
path: root/catalog-model/src
diff options
context:
space:
mode:
authorChris André <chris.andre@yoppworks.com>2020-05-05 12:39:20 -0400
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-05-06 14:39:14 +0000
commit5be1289bdded95df10c900d2d6f7596904287c91 (patch)
tree7b9f3bcc81959906ed198fae6053a83edb825877 /catalog-model/src
parent3b343466b5b4c7ca383d0ee281d158639f4eab2f (diff)
Make `collectNewCapabilities` return an empty Map
- Made `collectNewCapabilities` return an empty HashMap instead of a null value Issue-ID: SDC-2924 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I58c35135be5a2614c3daeafbd766d53f401f917b
Diffstat (limited to 'catalog-model/src')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupTypeOperation.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupTypeOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupTypeOperation.java
index a6538dcea1..ebaaf81cd8 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupTypeOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupTypeOperation.java
@@ -232,10 +232,12 @@ public class GroupTypeOperation implements IGroupTypeOperation {
* @param oldCapabilities
* @return
*/
- private Map<String, CapabilityDefinition> collectNewCapabilities(Map<String, CapabilityDefinition> updatedGroupTypeCapabilities, Map<String, CapabilityDefinition> oldCapabilities) {
- return updatedGroupTypeCapabilities != null? updatedGroupTypeCapabilities.entrySet().stream()
- .filter(entry -> !oldCapabilities.containsKey(entry.getKey()))
- .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue) ): null;
+ private Map<String, CapabilityDefinition> collectNewCapabilities(
+ Map<String, CapabilityDefinition> updatedGroupTypeCapabilities,
+ Map<String, CapabilityDefinition> oldCapabilities) {
+ return updatedGroupTypeCapabilities != null ? updatedGroupTypeCapabilities.entrySet().stream()
+ .filter(entry -> !oldCapabilities.containsKey(entry.getKey()))
+ .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)) : new HashMap<>();
}
private JanusGraphOperationStatus createCapabilities(GroupTypeData groupTypeData, Map<String, CapabilityDefinition> groupCapabilities) {