Skip to content

ConcurrentModificationException occasionally thrown in TokenizerThread #841

Description

@FlorianKroiss

In my case this happens sometimes when comparing two xml files.
Steps to (sometimes) reproduce:

  1. Create test.xml with example content from here. It seems to happen more frequently when the compared files are larger, so I copy/pasted the book elements in the file a few times.
  2. Copy file to test2.xml
  3. Select both files.
  4. Right click and Compare With > Each Other.
  5. The following exception is logged:
java.util.ConcurrentModificationException
	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1229)
	at org.eclipse.tm4e.core.internal.theme.Theme.match(Theme.java:87)
	at org.eclipse.tm4e.core.internal.registry.SyncRegistry.themeMatch(SyncRegistry.java:104)
	at org.eclipse.tm4e.core.internal.grammar.AttributedScopeStack._pushAttributed(AttributedScopeStack.java:175)
	at org.eclipse.tm4e.core.internal.grammar.AttributedScopeStack.pushAttributed(AttributedScopeStack.java:157)
	at org.eclipse.tm4e.core.internal.grammar.LineTokenizer.handleCaptures(LineTokenizer.java:484)
	at org.eclipse.tm4e.core.internal.grammar.LineTokenizer.scanNext(LineTokenizer.java:209)
	at org.eclipse.tm4e.core.internal.grammar.LineTokenizer.scan(LineTokenizer.java:131)
	at org.eclipse.tm4e.core.internal.grammar.LineTokenizer.tokenizeString(LineTokenizer.java:564)
	at org.eclipse.tm4e.core.internal.grammar.Grammar._tokenize(Grammar.java:342)
	at org.eclipse.tm4e.core.internal.grammar.Grammar.tokenizeLine(Grammar.java:259)
	at org.eclipse.tm4e.core.model.TMTokenizationSupport.tokenize(TMTokenizationSupport.java:81)
	at org.eclipse.tm4e.core.model.TMModel$TokenizerThread.revalidateTokens(TMModel.java:250)
	at org.eclipse.tm4e.core.model.TMModel$TokenizerThread.run(TMModel.java:173)

Maybe this is similar to the multithreading problem in #744

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions