Skip to content

The Unified and Autonomous Development Platform

Remove the thread-safe protection code when use the JSyntax tokenizer

robin shen616e4c32749c
diff --git a/core/src/main/java/com/gitplex/server/util/diff/DiffUtils.java b/core/src/main/java/com/gitplex/server/util/diff/DiffUtils.java
index fcade021e1..b6dba7749b 100644
--- a/core/src/main/java/com/gitplex/server/util/diff/DiffUtils.java
+++ b/core/src/main/java/com/gitplex/server/util/diff/DiffUtils.java
@@ -45,13 +45,6 @@ public class DiffUtils {
private static List<List<Token>> tokenize(List<String> lines, @Nullable String fileName) {
Tokenizer tokenizer = TokenizerRegistry.getTokenizer(fileName);
if (tokenizer != null) {
- //TODO: Some tokenizers are not thread safe, and we are using a temporary fix here
- try {
- tokenizer = TokenizerRegistry.getTokenizer(fileName).getClass().newInstance();
- } catch (InstantiationException | IllegalAccessException e) {
- throw new RuntimeException(e);
- }
-
List<List<Token>> tokenizedLines = tokenizer.tokenize(lines);
List<List<Token>> refinedLines = new ArrayList<>();
for (List<Token> tokenizedLine: tokenizedLines) {