Commit 64efefb6 authored by Dennis Ushakov's avatar Dennis Ushakov
Browse files

optimize check in tests

parent a6cff6cc
Showing with 2 additions and 1 deletion
+2 -1
......@@ -43,6 +43,7 @@ class CachedValueLeakChecker {
private static final Logger LOG = Logger.getInstance("#com.intellij.util.CachedValueChecker");
private static final boolean DO_CHECKS = ApplicationManager.getApplication().isUnitTestMode();
private static final Set<String> ourCheckedKeys = ContainerUtil.newConcurrentSet();
private static final boolean JAVA9 = SystemInfo.isJavaVersionAtLeast("9");
static void checkProvider(@NotNull final CachedValueProvider provider,
@NotNull final Key key,
......@@ -50,7 +51,7 @@ class CachedValueLeakChecker {
if (!DO_CHECKS || ApplicationInfoImpl.isInStressTest()) return;
if (!ourCheckedKeys.add(key.toString())) return; // store strings because keys are created afresh in each (test) project
if (!SystemInfo.isJavaVersionAtLeast("9")) {
if (!JAVA9) {
findReferencedPsi(provider, userDataHolder, 5);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment