Skip to content

Commit 717c55b

Browse files
trancexpressmerks
authored andcommitted
Support concurrent access on ContextTypeRegistry.fContextTypes
This change adjusts ContextTypeRegistry to use a ConcurrentHashMap. NOTE: As a result, iteration order of contextTypes() is no longer deterministic, previously this was guaranteed by the underlying LinkedHashMap. Fixes: #4020
1 parent ad80376 commit 717c55b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bundles/org.eclipse.text/src/org/eclipse/text/templates/ContextTypeRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
package org.eclipse.text.templates;
1515

1616
import java.util.Iterator;
17-
import java.util.LinkedHashMap;
1817
import java.util.Map;
18+
import java.util.concurrent.ConcurrentHashMap;
1919

2020
import org.eclipse.jface.text.templates.TemplateContextType;
2121

@@ -32,7 +32,7 @@
3232
public class ContextTypeRegistry {
3333

3434
/** all known context types */
35-
private final Map<String, TemplateContextType> fContextTypes= new LinkedHashMap<>();
35+
private final Map<String, TemplateContextType> fContextTypes= new ConcurrentHashMap<>();
3636

3737
/**
3838
* Adds a context type to the registry. If there already is a context type

0 commit comments

Comments
 (0)