Skip to content

Commit

Permalink
[mqtt] fix thread concurrency issue with type provider (openhab#14229)
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Cutrer <cody@cutrer.us>
  • Loading branch information
ccutrer authored and renescherer committed Mar 23, 2023
1 parent a34b90f commit 0bd72cd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

import java.net.URI;
import java.util.Collection;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
Expand Down Expand Up @@ -53,9 +53,9 @@
public class MqttChannelTypeProvider implements ThingTypeProvider, ChannelGroupTypeProvider, ChannelTypeProvider {
private final ThingTypeRegistry typeRegistry;

private final Map<ChannelTypeUID, ChannelType> types = new HashMap<>();
private final Map<ChannelGroupTypeUID, ChannelGroupType> groups = new HashMap<>();
private final Map<ThingTypeUID, ThingType> things = new HashMap<>();
private final Map<ChannelTypeUID, ChannelType> types = new ConcurrentHashMap<>();
private final Map<ChannelGroupTypeUID, ChannelGroupType> groups = new ConcurrentHashMap<>();
private final Map<ThingTypeUID, ThingType> things = new ConcurrentHashMap<>();

@Activate
public MqttChannelTypeProvider(@Reference ThingTypeRegistry typeRegistry) {
Expand Down

0 comments on commit 0bd72cd

Please sign in to comment.