From 1cf15fe4e2eb519ccf3838060592934efc83b300 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Mon, 5 Oct 2020 14:11:45 +0200 Subject: [PATCH] [Fix] Fixed MapOfMaps.computeIfAbsent() --- .../src/main/java/li/strolch/utils/collections/MapOfLists.java | 2 +- .../src/main/java/li/strolch/utils/collections/MapOfMaps.java | 2 +- .../src/main/java/li/strolch/utils/collections/MapOfSets.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfLists.java b/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfLists.java index ce4d2bb5e..3b5cae746 100644 --- a/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfLists.java +++ b/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfLists.java @@ -145,7 +145,7 @@ public class MapOfLists { if ((u = getList(key)) == null) { List newValue; if ((newValue = mappingFunction.apply(key)) != null) { - addList(key, newValue); + this.mapOfLists.put(key, newValue); return newValue; } } diff --git a/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfMaps.java b/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfMaps.java index 2ec70b283..5916559fb 100644 --- a/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfMaps.java +++ b/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfMaps.java @@ -220,7 +220,7 @@ public class MapOfMaps { if ((u = getMap(key)) == null) { Map newValue; if ((newValue = mappingFunction.apply(key)) != null) { - addMap(key, newValue); + this.mapOfMaps.put(key, newValue); return newValue; } } diff --git a/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfSets.java b/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfSets.java index eb2afa2a0..db9d04889 100644 --- a/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfSets.java +++ b/li.strolch.utils/src/main/java/li/strolch/utils/collections/MapOfSets.java @@ -163,7 +163,7 @@ public class MapOfSets { if ((u = getSet(key)) == null) { Set newValue; if ((newValue = mappingFunction.apply(key)) != null) { - addSet(key, newValue); + this.mapOfSets.put(key, newValue); return newValue; } }