diff --git a/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java b/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java index a29a90e96c3..5bf9e44f67e 100644 --- a/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java +++ b/bundles/org.openhab.core.automation.rest/src/main/java/org/openhab/core/automation/rest/internal/ThingActionsResource.java @@ -14,12 +14,12 @@ import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; import javax.annotation.security.RolesAllowed; import javax.ws.rs.Consumes; @@ -95,7 +95,7 @@ public class ThingActionsResource implements RESTResource { private final LocaleService localeService; private final ModuleTypeRegistry moduleTypeRegistry; - Map> thingActionsMap = new HashMap<>(); + Map> thingActionsMap = new ConcurrentHashMap<>(); private List moduleHandlerFactories = new ArrayList<>(); @Activate @@ -111,7 +111,7 @@ public void addThingActions(ThingActions thingActions) { String scope = getScope(thingActions); if (handler != null && scope != null) { ThingUID thingUID = handler.getThing().getUID(); - thingActionsMap.computeIfAbsent(thingUID, thingUid -> new HashMap<>()).put(scope, thingActions); + thingActionsMap.computeIfAbsent(thingUID, thingUid -> new ConcurrentHashMap<>()).put(scope, thingActions); } }