From fe62a4fdaead2fc9e38836127e9d8da71fe33b5e Mon Sep 17 00:00:00 2001 From: Kai Kreuzer Date: Sun, 29 Nov 2020 11:02:00 +0100 Subject: [PATCH] Make maps thread safe (#1856) Signed-off-by: Kai Kreuzer --- .../core/model/rule/runtime/internal/DSLRuleProvider.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.core.model.rule.runtime/src/org/openhab/core/model/rule/runtime/internal/DSLRuleProvider.java b/bundles/org.openhab.core.model.rule.runtime/src/org/openhab/core/model/rule/runtime/internal/DSLRuleProvider.java index 5001382e1..f211a66e6 100644 --- a/bundles/org.openhab.core.model.rule.runtime/src/org/openhab/core/model/rule/runtime/internal/DSLRuleProvider.java +++ b/bundles/org.openhab.core.model.rule.runtime/src/org/openhab/core/model/rule/runtime/internal/DSLRuleProvider.java @@ -14,13 +14,13 @@ package org.openhab.core.model.rule.runtime.internal; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; import org.eclipse.emf.ecore.EObject; @@ -88,9 +88,9 @@ public class DSLRuleProvider private final Logger logger = LoggerFactory.getLogger(DSLRuleProvider.class); private final Collection> listeners = new ArrayList<>(); - private final Map rules = new HashMap<>(); - private final Map contexts = new HashMap<>(); - private final Map xExpressions = new HashMap<>(); + private final Map rules = new ConcurrentHashMap<>(); + private final Map contexts = new ConcurrentHashMap<>(); + private final Map xExpressions = new ConcurrentHashMap<>(); private int triggerId = 0; private Set markers = new HashSet<>();