Skip to content

Commit

Permalink
fix: ConcurrentModificationException in BasicScopeAttributesProvider
Browse files Browse the repository at this point in the history
Addresses #743
  • Loading branch information
sebthom committed Apr 9, 2024
1 parent 0dc90e2 commit 8e326b4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.regex.Pattern;

import org.eclipse.jdt.annotation.Nullable;
Expand All @@ -37,7 +39,7 @@ final class BasicScopeAttributesProvider {
private final BasicScopeAttributes _defaultAttributes;
private final ScopeMatcher<Integer /* languageId */> _embeddedLanguagesMatcher;

private final Map<String /*scopeName*/, BasicScopeAttributes> cache = new HashMap<>();
private final ConcurrentMap<String /*scopeName*/, BasicScopeAttributes> cache = new ConcurrentHashMap<>();

BasicScopeAttributesProvider(final int initialLanguage, @Nullable final Map<String, Integer> embeddedLanguages) {
this._defaultAttributes = new BasicScopeAttributes(initialLanguage, OptionalStandardTokenType.NotSet);
Expand Down

0 comments on commit 8e326b4

Please sign in to comment.