diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2018-03-06 13:33:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-06 13:33:42 +0000 |
commit | 34b3e5749a37d3d9b715da77cc900b556c871b5f (patch) | |
tree | 189cf9f3d623c485c01386b31ab202b8c8680588 | |
parent | 61d12d7316fd6ca53375712e038c599702d102b1 (diff) | |
parent | 51343e00c0c435d71d55a747ed15ebe75fa63371 (diff) |
Merge "Make use of Map.getOrDefault"
-rw-r--r-- | bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java | 8 |
1 files 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<String, Serializable> mapForType = dictionary.get(type); - - if (mapForType == null) { - mapForType = new HashMap<String, Serializable>(); - dictionary.put(type, mapForType); - } + Map<String, Serializable> mapForType = dictionary + .computeIfAbsent(type, k -> new HashMap<String, Serializable>()); mapForType.put(key, value); } |