mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
optimize check in tests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user