mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
cache intermediate computation results thread-locally even if recursion prevention has occurred before (IDEA-70668)
This commit is contained in:
@@ -11,6 +11,7 @@ import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.testFramework.ResolveTestCase;
|
||||
|
||||
public class ResolveClassTest extends ResolveTestCase {
|
||||
@@ -154,6 +155,31 @@ public class ResolveClassTest extends ResolveTestCase {
|
||||
assertNull(target);
|
||||
}
|
||||
|
||||
public void testStaticImportInTheSameClass() throws Exception {
|
||||
PsiReference ref = configure();
|
||||
long start = System.currentTimeMillis();
|
||||
assertNull(ref.resolve());
|
||||
PlatformTestUtil.assertTiming("exponent?", 20000, System.currentTimeMillis() - start);
|
||||
}
|
||||
|
||||
public void testStaticImportNetwork() throws Exception {
|
||||
PsiReference ref = configure();
|
||||
int count = 20;
|
||||
|
||||
String imports = "";
|
||||
for (int i = 0; i < count; i++) {
|
||||
imports += "import static Foo" + i + ".*;\n";
|
||||
}
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
createFile(myModule, "Foo" + i + ".java", imports + "class Foo" + i + " extends Bar1, Bar2, Bar3 {}");
|
||||
}
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
assertNull(ref.resolve());
|
||||
PlatformTestUtil.assertTiming("exponent?", 20000, System.currentTimeMillis() - start);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"ConstantConditions"})
|
||||
private void configureDependency() {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user