From 51343e00c0c435d71d55a747ed15ebe75fa63371 Mon Sep 17 00:00:00 2001 From: Munir Ahmad Date: Fri, 2 Mar 2018 19:36:58 -0500 Subject: Make use of Map.getOrDefault Change-Id: Ifcd5c9b79179ee9ffd6705990bd4b1991034fb48 Issue-ID: SO-437 Signed-off-by: Munir Ahmad --- .../src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java index 64068d2b90..b65034432d 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java @@ -54,12 +54,8 @@ public class RollbackData implements Serializable { * @param value the value */ public void put(String type, String key, String value) { - Map mapForType = dictionary.get(type); - - if (mapForType == null) { - mapForType = new HashMap(); - dictionary.put(type, mapForType); - } + Map mapForType = dictionary + .computeIfAbsent(type, k -> new HashMap()); mapForType.put(key, value); } -- cgit 1.2.3-korg