Skip to content

Commit 8e326b4

Browse files
committed
fix: ConcurrentModificationException in BasicScopeAttributesProvider
Addresses #743
1 parent 0dc90e2 commit 8e326b4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/grammar/BasicScopeAttributesProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import java.util.Collections;
2121
import java.util.HashMap;
2222
import java.util.Map;
23+
import java.util.concurrent.ConcurrentHashMap;
24+
import java.util.concurrent.ConcurrentMap;
2325
import java.util.regex.Pattern;
2426

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

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

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

0 commit comments

Comments
 (0)