From: Munir Ahmad Date: Sat, 3 Mar 2018 00:36:58 +0000 (-0500) Subject: Make use of Map.getOrDefault X-Git-Tag: v1.2.1~508^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=51343e00c0c435d71d55a747ed15ebe75fa63371;p=so.git Make use of Map.getOrDefault Change-Id: Ifcd5c9b79179ee9ffd6705990bd4b1991034fb48 Issue-ID: SO-437 Signed-off-by: Munir Ahmad --- 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); }