give cached values a chance to survive between reparsing

GitOrigin-RevId: a38c853915151146b3eb812e7ab117dfb733b424
This commit is contained in:
Dennis Ushakov
2019-08-01 14:03:25 +03:00
committed by intellij-monorepo-bot
parent a1df355ccf
commit 40a52aac03
@@ -31,7 +31,7 @@ import java.util.concurrent.ExecutionException;
import static org.jetbrains.plugins.textmate.regex.RegexFacade.regex;
public final class SyntaxMatchUtils {
private static final LoadingCache<MatchKey, TextMateLexerState> CACHE = CacheBuilder.newBuilder().maximumSize(32768).weakValues()
private static final LoadingCache<MatchKey, TextMateLexerState> CACHE = CacheBuilder.newBuilder().maximumSize(32768).softValues()
.build(CacheLoader.from(
key -> matchFirstUncached(Objects.requireNonNull(key).descriptor, key.string, key.byteOffset, key.priority, key.currentScope)));
private final static Joiner MY_OPEN_TAGS_JOINER = Joiner.on(" ").skipNulls();